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
-
1
votes0
answers149
viewsError generating Migration after changing a relationship
I’m having an error when changing a relationship Many to Many in the Entity framework I had 3 classes: Politics 1-n Politicabnormal n-1 Normative It turns out that I didn’t want to map this…
-
1
votes1
answer120
viewsChanging a Controller name without losing information
I have a Controller called Home and I want to change the same to BPA. I want to know if I can just change the name HomeController for BpaController and change the name of the Home folder in the View…
asp.net-mvcasked 7 years, 2 months ago Italo Rodrigo 4,344 -
1
votes1
answer53
viewsPersist the same record by different user
I’ve seen that there’s a way, but I can’t remember how you do it and not a keyword for me to search. Suppose that distinct users edit the same record, when the last user will persist the information…
-
1
votes3
answers495
viewsSend email asynchronously Asp.net mvc
I have a return form Actionresult who sends an email after completing the operation. I would like to leave this asynchronous email, because it takes a lot of time, I tried to put in a Task using the…
-
1
votes1
answer825
viewsCS0246 error when creating a new Asp.net mvc core application
I have a problem, when creating a new project Asp.net-core in visual studio 2017 appears the following error when compiling: CS0246 The type or namespace name "System" cannot be found(missing a…
-
1
votes2
answers673
viewsHow to return to the previous page by Handleerrorattribute?
I am trying to implement a global filter for error handling and started testing as follows: public class MyHandleErrorAttribute : HandleErrorAttribute { public override void…
-
1
votes2
answers147
viewsError loading Dialog Widget() jQuery in ASP.NET MVC
I installed jQueryUI, I changed my Bundleconfig, but still the browser does not recognize the Dialog() widget in my script jquery.dialogo.js. I checked if the library is being loaded and everything…
asp.net-mvcasked 9 years, 2 months ago Kelly Soares 1,181 -
1
votes1
answer173
viewsInner Join in tables 1 - n
I have two tables: Vehicle and Images, where a vehicle can have n images. When performing an Inner Join I get the following result: Vehicles1-Addressimage Vehicles1-Addressimage…
-
1
votes1
answer274
viewsStandardize error messages in Dataannotations in Viewmodels classes
It is possible to standardize the error messages used in Dataannotations, so that it is not necessary to pass a string like: [Required(ErrorMessage = "Este campo é obrigatório.")] But you can use it…
-
1
votes2
answers125
viewsEdit Image in database when field is empty
I have a code that uploads image. In the database worked beautifully. Now I need to make a code that changes the image only when it is selected. That is, in my case, when I change a record, you must…
-
1
votes1
answer338
viewsHow to take a Domain Entity method to higher layers
Hello, I have the following domain entity. public class Cliente{ [Key] public string CPF{get; set;} public string Nome{get; set;} //Outras propriedades public void Sacar(Conta conta, decimal valor){…
-
1
votes1
answer122
viewsView 3 Models in a View
I have 3 Models and I need to assemble 2 (two) lists and a "Save) button": Class: Tbproduct: public class TBProduto { [Key] public int TBPRODUTOID { get; set; } public string DSPRODUTO { get; set; }…
-
1
votes1
answer244
viewsHow to display domain validations and errors in a partial modal bootstrap view?
I am using DDD and have some validations in my domain that need to be done, but when I use Modelstate.Addmodelerror and return my model and my Partialview, the form of my Partial does not remain in…
-
1
votes0
answers25
viewsWhy Elmah.Mvc asks for authentication when requiresAuthentication=false
I wonder why the Elmah.Mvc when we enter the page ~/Elmah Does it always ask for login of my application? The option in webconfig requiresAuthentication is as false and yet you request it. Someone’s…
asp.net-mvcasked 7 years, 1 month ago Rogerio Potenza 11 -
1
votes0
answers15
viewsDoubt with Redirecttoaction
Is it possible to redirect when the site uses an anchor? I have this situation, where my anchor has the contact name, wanted to redirect to this part of the code. public ActionResult email() {…
asp.net-mvcasked 7 years, 1 month ago Harry 3,805 -
1
votes2
answers385
viewsWebapi - Tryupdatemodel or Updatemodel in an Apicontroller
I have the following situation, a Person class, with properties Id, Name, Birth, I want to implement a page that can update only the Person Name. My implementation should take a person by their id,…
-
1
votes0
answers81
viewsBag nhibernate with key null
Hello, Does anyone know if it is possible to use nhibernate Bag with Key Null? In a table some records have several related records, one for many, but not always, sometimes a region will not have…
-
1
votes0
answers31
viewsRequest status after browser close
I have an Asp.Net MVC project and I realized that when I close the browser immediately after the beginning of a request (without waiting for its due ending), it makes somehow the server does not…
-
1
votes1
answer116
viewsEF6 and NPGSQL : Foreign key breach error
Good afternoon ! I’m new to ASP.NET and EF6. I used to develop in PHP. I created a project (ASP.NET MVC) using EF6 and NPGSQL. I got a little bit when creating relationships between two tables but…
-
1
votes1
answer501
viewsPass parameter through GET with Asp.Net MVC?
I am creating a search screen and for this I created a Model with some attributes of the type Datetime to do a search by date period. The problem is that when I pass these parameters to the method…
asp.net-mvcasked 7 years, 1 month ago FernandoPaiva 1,562 -
1
votes1
answer497
viewsCommunication between MVC Controllers
I’m having trouble making a communication between Controllers each in a Area different, the public methods of the second controller are not available in the first. Is there any way to do this?…
-
1
votes0
answers110
viewsError :An Exception occurred while initializing the database. See the Innerexception for Details
Someone could help me in this era that I always come across him and after numerous attempts, I can not find this error, I am developing an application in MVC 3 exploring more this part of the Code…
-
1
votes0
answers26
viewsControl Dslr camera via web
People: I have a web application that I would like to be plugging in a dslr (professional camera) camera that would display the live image in a canvas in html or something, and that would literally…
-
1
votes0
answers73
viewsCall procedure in the Onclick of <area> in the Image Map in ASP.NET
Good afternoon, I have this code: <img src="../Image/sala.png" USEMAP="#sala" BORDER=0> <area name="window" shape="poly" coords="633,82,631,117,627,145,625,160,644,162,671" href=""…
-
1
votes1
answer59
viewsUpdating the Listing Data
I have a small problem, in the image below I have a list of customers. There is a button that opens a modal for editing, it works normal, but after editing the close modal and need to update the…
-
1
votes1
answer174
viewsUncaught Error: [$injector:modulerr] - Asp.Net MVC
I’m having trouble uploading data from controller in Angular. I’m not understanding, I followed step by step the explanation and mine gave this error. var app = angular.module('app', []);…
-
1
votes0
answers33
viewsCommunication socket in Windows service
Next, I have a problem with an application I am developing, I need to carry out a communication between a Windows service and a web application, the Windows service will stay in the local…
-
1
votes0
answers19
viewsUnderstanding the MVC routes
I’m about to start a project in MVC 5 . NET but I don’t understand very well how it works this framework route. I’m used to ASP.NET 4.5 where I know that: The .aspx is the front-end. The .aspx.cs is…
-
1
votes0
answers22
viewsClient question for a webapi
I have a slight doubt... concludes a webapi in Asp.net core, it is all tested and everything , however, I came up with a question... It includes a new project next to this api, so it is the client…
-
1
votes1
answer210
viewsSend email to register form
Personal I need a help from you, I have a form on my system, I need when I register it send an email to a user. When I click save I enter this post to save the data. [HttpPost] public void…
-
1
votes1
answer393
viewsHow to import log file into Asp.net mvc with Entity framework
I would like to ask a question and I do not know how to structure my need.. I need to import/export a file with records, and depending on each record will be a different table, with its references…
-
1
votes1
answer55
viewsError in application Asp.net mvc
I have the error below and do not know how to solve. Does anyone have any idea what to be and how to solve? Severity Code Description Project File Line Suppression State Error Unable to copy file…
asp.net-mvcasked 7 years ago Marco Souza 12,304 -
1
votes2
answers1487
viewsSave Image in Database with C#
Hello! I saw the example Upload image to picturebox and write to database but I didn’t get that part: FileStream Stream = new FileStream(imgLocation, FileMode.Open, FileAccess.Read); What would this…
-
1
votes1
answer373
viewsProblems with Lambda and Datetime consultation
Hello I have the following Actionresult code from my controller below: [HttpPost] [AuthorizedUser] public ActionResult Load(DateTime DataInicial, DateTime DataFinal) { var AcessoDominio = new…
-
1
votes1
answer305
viewsDevelop an MVC project with Web API
Someone asks me to develop an MVC application with various technological elements such as Angular, Bootstrap, Entity and so on. I then create a Web API project, can I guarantee to this person that…
-
1
votes0
answers343
viewsBootstrap is not being rendered by _Layout
I have this layout page. This layout already came, I didn’t make it. I just don’t understand why it was created if I opted for a MVC Empty(Empty) project, but it’s not bothering me. <!DOCTYPE…
-
1
votes1
answer69
viewsSubtract the current value from the previous one
I’m trying to make a supply system, I need it to take the last km registered in the bank of a specific vehicle and be subtracted by the new that will be inserted I’m trying to do so, but it shows no…
-
1
votes1
answer59
viewsHow to use a hyphenated parameter in an HTML Helper?
Hello I’m using the Data Annotation ASP.NET MVC in C#, but I’m not getting past ASP.NET data-toggle in the helper CheckBoxFor: @Html.CheckBoxFor(model => model.ReceberEmail, new { @class…
-
1
votes0
answers57
viewsCommunication between View and Controller via a script
I’m trying to call an Action through . ajax that runs inside a Modal button but apparently the url is not processed. My View is like this: @using (Html.BeginForm()) { <div…
-
1
votes1
answer291
viewsHow to pass ID via Javascript to a View
In the application I am developing use Views of the type modal. Use this code to display the modal: <button class="btn btn-default details" data-id="@clientes.Codigo"><i class="glyphicon…
-
1
votes0
answers93
viewsASP.Net MVC - Draw in PDF file?
I’m creating a system in Asp.Net MVC and I need to create a scheme for the user to draw his signature in a.pdf file that is corresponding to a contract and I am looking for a way to do this but…
-
1
votes2
answers108
viewsCreate Database using Fluent Nhibernate
Is there any way to create a new database directly from my application? I’m using Asp.Net MVC5 C#, Fluent Nhibernate and Postgresql. Note: I can already access my tables through the application,…
-
1
votes1
answer2211
viewsDifference between @Html.Labelfor and @Html.Displaynamefor
I am starting at ASP.NET MVC and taking a course where the teacher used to display the data of a different class methods to display a given. He uses the @Html.LabelFor and the @Html.DisplayNameFor.…
-
1
votes1
answer118
viewsDisplaying welcome message at navbar!
I’m doing an app on MVC Asp.net. When the user logs in I would like you to display the welcome message bringing the user name, however you are bringing the email, as I change this? My action is that…
-
1
votes4
answers444
viewsIncorrect date on return of json
Good afternoon, Json’s return brings the badly formatted date = "/Date(1420077600000)/", how to treat ? {"TB1":1,"DTADMISSAO":"\/Date(1420077600000)\/"} This is the section where the Data field:…
-
1
votes2
answers347
viewsNinject Not creating the Ninjectwebcommon class
I’m installing the package of ninject, but the class is not created Ninjectwebcommon automatically in the folder App_start. Does anyone have any solution? I am installing the version Ninject.MVC5.…
-
1
votes0
answers280
viewsAdd field of decimal type Entity framework
I have a Repair table in it I have Valuemade, Value and Total Value all of the decimal type. The Value field = Valuemaod + Value Library. However this returning 0. I am showing this in the Detail…
-
1
votes0
answers111
viewsDoubt with hangfire.io, (BACKGROUND PROCESSING)
Dear friends, I am using www.hangfire.io for background processing in my system, so far without problems, but it weighed a doubt. If Jobs are running, and I publish a new version of the site, what…
-
1
votes1
answer95
viewsPerforming a query C#
I have a controller where I make a Select to get a list, but it returns empty. public IEnumerable<Check> GetUserByNumberOfregistration(int numberOfregistrationUser) { CheckContext contextObj =…
-
1
votes1
answer73
viewsPass a list to a view to get via Javascript
I have a method Index, where it takes a parameter, makes a query and returns a list. I need to run that list along with view or get that list some other way, so I can access list via Angularjs.…