Most voted "asp.net-mvc" questions
ASP.NET MVC is an open-source Microsoft framework that implements the Model View Controller architecture standards for web development. Based on ASP.NET, it allows software developers to build web applications following the Model View Controller architecture standards, featuring a variety of features following recent trends.
Learn more…3,385 questions
Sort by count of
-
0
votes3
answers87
viewsASP.net MVC error
I have this code, working perfectly as I wish @using (Html.BeginForm()) { @Html.AntiForgeryToken() <div class="container"> <form class="well form-horizontal">…
-
0
votes0
answers63
viewsSave value from a variable within a controller to use in another DLL run method
I need to save information in the User Login and use this information in another DLL. EX: Projeto.Web Projeto.Domain.dll When logging in the User Project.Web controller, I need to save which project…
-
0
votes1
answer1369
viewsFrom the View how to get the Model in Partial View
In the View leading, Index.cshtml, carry a partial view where this has a model. How to make Index call this one model so that I can serialize and send to a action in the controller? Below is an…
-
0
votes1
answer67
viewsHow to display two Textbox from a result in the Dropdownlist
I display a Dropdownlist with two SC and PR values, if it selects SC then I want it to display two Textbox, one with the RG, and one with the Date of Birth, and if the person selects PR, I want to…
-
0
votes1
answer1236
viewsError {"The object reference was not defined as an instance of an object." } System.Nullreferenceexception MVC ASP.NET
Well, it now gave me an error on the main page so I tried to pass the resgisto values to the index. the error is in line 35 of the index of the main page with the code: @foreach (var item in Model)…
-
0
votes1
answer179
viewsIs Asp.net MVC better working with Areas or Projects within a Solution?
I’m creating a portal and separating the modules by Areas. But the demands are increasing a lot, already has at least 5 more modules to be written in the portal. What is the best way forward in…
-
0
votes1
answer479
viewsOpen external program via mvc5
I’m having a hard time doing an operation. I have a console application that opens a PDF. This console takes the name of Servico.exe, although it has the service name, it is an exe and not a…
-
0
votes0
answers133
viewsHtml "active" of the Carousel
Good. I have a project with several views that contain a Carousel. For example, this is my main page and when I press, for example, the first "See more" button this appears So far so good! But if I…
-
0
votes1
answer75
viewssend request at the first button click
I have to fill some combobox at the click of a button. When I click on this button it first loads a modal and the second time I click it creates the modal loading the data I need, making the request…
-
0
votes1
answer47
viewsAPI problem after deploying
My api is not working after deploy to the server, it is returning: 404 - File or directory not found. The Resource you are Looking for Might have been Removed, had its name changed, or is…
-
0
votes2
answers142
viewsIs there any way for a form to inherit from _Layout.cshtml in c#?
I’m developing a website on asp.net c#, I have a contact page that contains a form for the user to fill and send if you want to send an email. I wanted the page of this form to inherit the…
-
0
votes1
answer338
viewsI can’t download a file by Actionlink mvc5
I know the error is in the way I am interpreting the routine. I have a routine to download a file attached to a table. This file was generated by my application (binary) and now I need to write this…
-
0
votes1
answer36
viewsRemove space in the name of an input
It’s like, I’m doing a foreach this way . int count = 1; @foreach (var item in Model) { <input name="itemId_@count" value="@item.ProdutoId" type="hidden"> count++; } The problem is that in…
-
0
votes1
answer42
viewsFormsauthenticate + jQuery Ajax
I am creating an application that uses Formsauthenticate to log into the system. However, I would like to make a treatment so that in an ajax request (jquery) made when the user is not logged in. I…
-
0
votes1
answer132
viewsDoubt with Webapi data insertion
I’m using the Postman: Error: "Undefined object reference for an object instance." I have the Controller Code: //http://localhost:1608/api/ApiGuiaCidade/cadastrar/cliente //"Referência de objeto não…
-
0
votes2
answers1053
viewsPut a datepicker in a mvc 5 view with jquery or similar
I have this Razor in my view: <div class="form-group"> @*@Html.LabelFor(model => model.DT_AGENDAMENTO, htmlAttributes: new { @class = "control-label col-md-2" })*@ @Html.Label("Data de…
-
0
votes0
answers120
viewsMvc dbSet<Reserve> does not contain a definition for getAll()
I created this method, however I get the error described above, someone knows a possible solution? public IEnumerable<Reserva> GetBookingsByRoomId(int Id) { HotelEntities db = new…
-
0
votes2
answers133
viewsRemove from mvc page " 2017 - Project Name"
I have an Razor page that I call inside another page, and because I have this identification: 2017 - Cronoparque, appears twice on the "same page", since I call one, inside the other, I would like…
-
0
votes1
answer54
viewsCrystal Report does not allow creating parameter
I’m trying to create a parameter in Crystal Report and when I click Ok nothing happens. Is there parameter limitation in Crystal in one project? because I read something similar in another forum.…
-
0
votes1
answer249
viewsError while trying to create a Controller or Apicontroller
I created an empty Asp.Net Core 2.0 project (no scaffold). DDD model and etc. However when I try to create my controller, whether inherited from Apicontroller or Controller, it gives error:…
-
0
votes2
answers112
viewsHow to add a built-in view to an Asp.net core 2.0 controller
I created a view (Razor Page) in an Asp.Net Core 2.0 project. How I build it from scratch and I now need to assign a controller to it. How do I do it?
-
0
votes0
answers349
viewsHow to run a javascript function on the server side?
On the server side: return JavaScript("Callback()"); On the client side: function Callback(){ // } The result is displayed as "Callback()" on the web page, I took the example here. Some solution ?…
-
0
votes2
answers100
viewsHow to recover address ID?
I’m using Asp.mvc. On my route has the ID, the page address for example has http://user/1 . I wanted to get this number 1 at the bottom of the page, there’s some way to do it?…
-
0
votes1
answer491
viewsHow to display messages (Summay) to the user in the Index view
I have a View Index and via the Create view is opened in a modal form from it. When I open the Create modal, I fill in the fields and click on the save button the modal remains open and Summary…
-
0
votes1
answer49
viewsMake a free query using the Entity frame MVC
I would like to bring a result of a days calculation using mvc with Entity frame. My appointment would be this : select Notas_IdSoft, Notas_TipoLic, t.Notas_Validade, DATEDIFF(DAY, GETDATE(),…
asp.net-mvcasked 6 years, 4 months ago stella 11 -
0
votes1
answer649
viewsChange a JS Function to open two different Modal Bootstrap Windows - Asp.Net Core MVC
Currently, I have a Modal (modalGenerica) in my Index that opens the Create, Edit and Delete views in a generic way. To open the Create and Edit views, there is no problem, as both open in a modal…
-
0
votes1
answer103
viewsHow to make Asp.Net MVC application stop logging out, and stay logged in direct?
I developed an application in Asp.Net MVC and this application when the login is done and spends time without moving, when I will register, the system asks to log in again, I would like to know how…
-
0
votes1
answer67
viewsAjax return files from a directory (Asp.net MVC)
I would like to list the files in link form (to click to download). List the directory files below the upload input Ajax: function CarregaArquivos(Id) { $.ajax({ url:…
-
0
votes1
answer43
viewsConversion of Types with Fluenti API to EF Core 2.1
I would like to know if it is possible to make the following conversion: public class Pessoa { public bool Ativo { get; set; } } public class PessoaMap: IEntityTypeConfiguration<Pessoa> {…
c# asp.net-mvc asp.net-core code-first entity-framework-coreasked 6 years, 3 months ago Nicola Bogar 123 -
0
votes2
answers55
viewsInput appear with two numbers after the comma
I have this html, which I bring from a float: <input asp-for="Frete" name="Frete" onKeyPress="return(MascaraMoeda(this,'.',',',event))" class="form-control" /> I would like when you bring the…
asp.net-mvcasked 6 years, 2 months ago Mariana 2,512 -
0
votes0
answers34
viewsInclude direct input select - MVC
I have this select field, where I upload the database data: <label asp-for="CategoriaID" class="col-md-2 control-label"></label> <div class="col-md-6"> <select…
asp.net-mvcasked 6 years, 2 months ago Mariana 2,512 -
0
votes1
answer58
viewsImprove routes
Do people have a better way to do these routes? Or for every action in my Controller I’ll have to create your routing? app.UseMvc(routes => { routes.MapRoute( "Login", "Login", new { controller =…
-
0
votes1
answer1829
viewsCall action with button click by passing parameter
I will have 3 buttons, each with a different id, how do I pass this id to my controller action when clicked? public IActionResult Index(int id) { var lista = _listaService.sites(id); return…
-
0
votes2
answers89
viewsSelect field with first blank item
Utilise select and it comes filled from the bank: <select asp-for="CategoriaID" asp-items="@Model.CountryList" id="cbcategoria" class="form-control"> </select> And here’s how it’s in the…
asp.net-mvcasked 6 years, 2 months ago Mariana 2,512 -
0
votes1
answer109
viewsRedeem Cookie Values
Good afternoon I have an application in MVC that generates some cookies, I wonder if it is possible to redeem these cookies through an Api, because I tried and unfortunately could not. Code…
-
0
votes1
answer160
viewsHow to insert information into a Json object?
My problem is similar to that question: Question Stackoverflow But in this case the object is used Json to popular the table. Controller public ActionResult GetDadosItensVenda(int? Codigo) { try {…
-
0
votes2
answers46
viewsHow do I complete information that is in a complex JSON type?
I am trying to carry out the filling of a Icollection type that is owned by my Professional model. When performing the request I pass the information via JSON But in VS debug and GET the information…
asp.net-mvc json entity-framework relational-model modelasked 6 years, 1 month ago Fabricio Pereira Cardoso 33 -
0
votes2
answers100
viewsRazor language regionality
I’m having a problem with Razor (using MVC 2.1 .Net Core) when generating the screen, as follows code below, this appearing the correct date in my Local development environment, but after Publish…
-
0
votes0
answers214
viewsUpload Image and save to Asp.net server
Friends could help me create a function to record the path + image name in the database, and save the image on my server ? I’m using the field model.PhotoName which is a string to store the path,…
-
0
votes0
answers345
viewsDigital certified in ASP.NET Core 2.0
I have a project in ASP.NET Core 2.0 where I am generating PDF contracts, however, I need to sign them with the company’s A1 digital certificate, only this part is missing to finish the project.…
-
0
votes1
answer142
viewsHow to set the Index of a List to start at 1 instead of 0 when populated
Whenever I populate a list in C#, as in the example below, as I add items, they are arranged starting at position 0 in index. If I add 5 items to my list, I will have the positions 0, 1, 2, 3 and 4.…
-
0
votes1
answer1329
viewsError publishing C# MVC project, Could not load file or Assembly 'System.Web.Http.Webhost
I have a C# MVC project, that running in Visual Studio 2013, works, but when I go up to the server gives this error: Could not load file or Assembly 'System.Web.Http.Webhost, Version=4.0.0.0,…
-
0
votes1
answer24
viewsRender different Partialviews randomly
I have the following scenario: I have to move on to a view data from different tables (similar data, but without any relation), until then I got good. I created a class (viewmodel) that receives the…
-
0
votes1
answer60
viewsDate value from Jsonresult function 18/11/2018 00:00:00 javascript gets "/Date(1542506400000)/"
I’m having trouble receiving a function JsonResult that returns me a certain date and this date I am unable to pass to the Date field of my screen for reasons of coming a value other than field…
-
0
votes0
answers97
viewsRecords in Icollection<> navigation property are not being recorded
I’m trying to make an inclusion of items in a list property but I’m not able to include the records in the database. First I have the following class models: public class Frota { public Frota() {…
c# asp.net-mvc entity-framework entity-framework-6 asp.net-mvc-4asked 8 years, 11 months ago JamesTK 901 -
0
votes0
answers51
viewsProblems using the Googlemaps.Locationservices API on ASPNET MVC
I’m working on a development that plots multiple longitude and latitude locations coming from the SQL SERVER database that load onto a map after typing some search data. Below is the screen with the…
-
0
votes1
answer70
viewsHow to run a method on startup of ALL Controllers?
I have a static class that carries language in relation to cookie stored or the URL. Throughout controller I have to insert once the following method: protected override void…
-
0
votes1
answer64
viewsAlias directive - What would it be?
Good afternoon, everyone, I’ve been studying C#, I came to see about the Directive using, and in the C# documentation it says it has 3 uses, one of the 3 use items says it serves to create an…
-
0
votes1
answer129
viewsHow to redirect to an action on Asp.net mvc, using jquery?
How to redirect to an action in ASP.Net MVC, using Jquery? I’m trying to do it like this: $("#Filtro").change(function () { @Url.Action("Answer"); });
-
0
votes2
answers646
viewsSelect folder in directory in input
I need to put a input where the user selects the folder he wants to save the notes, but only select. I tried to do it this way: <input asp-for="Caminho" class="form-control" type="file" multiple…
asp.net-mvcasked 5 years, 11 months ago Mariana 2,512