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
votes1
answer3970
viewsPass a list of View objects to the Controller
I have a Customer class and an address, and a customer can have many addresses. I am trying to create a Client View where I can add as many clients as I want, and then I can add these addresses to…
-
1
votes1
answer557
viewsReturn to previous view with data filled in
I have 3 View’s, a main (Index) containing fields to perform filters and a search button, another ,Gridindex (rendered inside the Index view), where records are demonstrated based on search filters,…
-
1
votes1
answer2031
viewsHow to list all files from a server directory in ASP.NET MVC?
I want to know how to create a List<string> with the filenames of a given directory. The service is hosted on a shared server, published in my httpdocs. I have several images inside…
-
1
votes1
answer873
viewsUndefined object reference for an object instance.?
Can anyone help me with the error below? I implemented based on this link Permissioncookie…
-
1
votes3
answers220
viewsReturn in a view-specific div
I have a view where the contact form is at the bottom of the page, with validation via Dataannotations. When I click the send button, the controller checks the Modelstate, if it is not valid, it…
-
1
votes2
answers1346
viewsHow to login to WEB project Asp. Net MVC No Authentication?
Well, I created a WEB project and at first I figured I wouldn’t need to add the login system, so I used the template No Authentication (so far so good...). The problem is that now I would like to…
-
1
votes1
answer149
viewscustomize Roleprovider without using Membership or ASP.NET Identit
Good morning. My doubt and the following I have the authentication part of my system made without using Membership or ASP.NET Identit. and wanted to make or use the method [Authorize] already picked…
-
1
votes1
answer541
viewsCustomizing Individual User Accounts
Well, I have an Asp.Net MVC web project that uses Individual User Accounts and I would like to use a specific table in my database and a different class to manage user login. How can I do this?…
asp.net-mvc sql-server entity-framework asp.net-identityasked 9 years, 5 months ago Jedaias Rodrigues 6,718 -
1
votes1
answer108
viewsSQL database for multiple users
Well, I have a question. I am developing a web application that will suit more than one user, however each user has different data recorded in the database, and this volume will be great, since the…
-
1
votes1
answer2499
viewsHow to call controller action?
I have the following code: function confirmaExclusao() { var decisao = confirm("Deseja excluir permanentemente esse item?"); if(decisao == true) { //Chamar a action para excluir } else { //Aqui não…
-
1
votes0
answers90
views@HTML.Checkboxfor does not pass value to the model
I have the following problem: I have a checkbox on the page but even marking it, on controller the Model continues with the field lavagem = false. Model public bool lavagem { get; set; } View…
-
1
votes1
answer77
viewsHow to get user type in view?
I have an Asp.Net MVC project that uses Individual User Account with Owin. Everything is working perfectly, but I would like to get user type (role) in View. I’m using Request.IsAuthenticated to…
asp.net-mvc razor authentication asp.net-identity owinasked 9 years, 5 months ago Jedaias Rodrigues 6,718 -
1
votes1
answer116
viewsUser permissions calling all rules at each access
I have a MyRoleProvider implemented and access works normal, if the logged-in user does not have the rule registered he does not allow access. The problem is that at each access to an action with…
-
1
votes1
answer1321
viewsEdit object list with POST form in MVC C#
I have the two classes below. I know how to make a screen to enter the data, and take the data from PERSON and PHONE, by model and for List. But how to do this on an edit screen? I want to show the…
-
1
votes1
answer191
viewsViolation of multiple restriction
Someone has already come across this error in an Asp.net mvc application? Server Error in Application '/'. There was a restriction violation of multiplicity of relation: an Entityreference may not…
-
1
votes1
answer1005
viewsError saving list of MVC C#objects
As the post Edit object list with POST form in MVC C# I was able to make my application display the values. However, trying to save the data gives the error: The operation failed: The relationship…
-
1
votes2
answers946
viewsHow to resize images before upload using c#Asp.net
I am learning. net mvc 4 and would like to know if there is any good and simple library, to resize images before uploading, I googled and only found complex functions with resizing calculations made…
-
1
votes1
answer152
viewsLoad records from different tables as Anonymous type Entity framework
How can I load data from multiple tables in the Entity Framework? By RAW Query I get normal, but by the Entity Framework I’m not getting to the point. What I need is to select the last entry that…
-
1
votes3
answers206
viewsContext in services and repositories
In the company we work, we use Asp.net mvc divided into 2 projects: web - (groundwork) service - (business rules) In several places I have noticed other programmers using the direct context (that…
-
1
votes2
answers1465
viewsAutomatic date field fill in application
I have a form in my C# ASP.Net application where I need to fill in an initial and final date, but I want to standardize so that the final date is always 5 days after the initial date. How to do…
-
1
votes1
answer2030
viewsError adding Httppost to controller
I’m having a problem adding the attribute [HttpPost] on my controller. I mean, I can add the attribute without problems, but when I compile and go to the registration form I just can’t access. I get…
-
1
votes1
answer184
viewsProgress when requesting to download a file with Fileresult
How can I display a progressibar while the server processes a Fileresult return? I tried to perform the operation with Ajax, but it is not possible to download a file via ajax without redirecting it…
-
1
votes1
answer384
viewsHighlight link from current page
I am implementing a menu in the header of my page. As the user clicks on the buttons in this menu, the page is rendered just below. I would like to highlight in the menu the button referring to the…
-
1
votes1
answer403
viewsTwo types of search in the same textbox
I wonder if it is possible to search two types of variables (one at a time) in a single textbox. Example: public ActionResult Index(string pesquisa) { var usuario = from u in db.usuario select u; if…
-
1
votes1
answer308
viewsProblem when publishing a site iis 7
I need to publish a site that is on Asp.net mvc and when I publish and change the files in the existing folder in iis 6, the changes I made in the project do not appear when I open the site by iis.…
-
1
votes1
answer433
viewsText editor for email formatting
I need to create a page for creating and formatting emails. Which text editor is most reliable for doing this? I say this because some email viewers are very limited and do not interpret some HTML…
-
1
votes1
answer120
viewsAsp.Net Drop Down List
How do I pass one dropdownlist by parameter? I tried to pass, for example: public void preencheDrop(string SQL, WebControl x) { método aqui. } but I couldn’t. This method I just want to make my life…
-
1
votes2
answers672
viewsValidation model always fails
I have the following models: public class Local { [Key] public int Id { get; set; } public virtual Grupo Grupo { get; set; } } public class Grupo { [Key] public int Id { get; set; } [Required]…
-
1
votes1
answer499
viewsHow to publish an Asp.net website mvc 4 on iis6?
I give a Publish in visual studio 2012, I add a new website in iis6, I put the path of the published files folder, but when I go to the site, it opens the login screen and when I click in the page…
-
1
votes2
answers330
viewsHow to execute C# query for request control
I am new to programming and need to add some functionality in a C# Asp.net. One of them is a control that prevents the user from proceeding with the request if he has any pending in the system. I…
-
1
votes1
answer442
viewsProblem with Mysql Connector
I am using MVC 3, Entityframework 4 and Mysql database. I hosted my application on Locaweb. Unfortunately, I can’t connect the same thing to the database. Running the application on my local machine…
-
1
votes1
answer39
viewsLists do not load next to model
My model: public class Grupo: ModelBase { public Grupo() { this.Itens = new List<Item>(); } public Grupo(string nome): this() { this.Nome = nome; } public string Nome { get; set; } public…
-
1
votes1
answer177
viewsPublish ASP.Net website
I did my first "website" test on ASP.Net and when I publish it to my normal ftp (I’m using visual studio 2013) I open the domain http://aizensecurity.freevar.com/ gets all these folders and stuff...…
-
1
votes0
answers795
viewsLocaweb Publishing Error - ASP.NET with Mysql
I published a site on Locaweb: . Net + Mysql + MVC 4 + EF6 For more details of the error: http://locvip.tempsite.ws/ Detail: wheel location normally. But when I published it occurs the following:…
-
1
votes2
answers632
viewsSet model property in javascript variable
I have an Action Usuario that displays user details among other actions that can be performed. I also have a code javascript that needs in some part to set a model property in the javascript…
-
1
votes1
answer609
viewsUpdate modal content dynamically
I have a table with up to 10 services listed, and each row has a refresh button. By clicking the refresh button, a modal window opens with the data of this line, as well as a form for change.…
-
1
votes1
answer422
viewsHow to handle code in a DLL?
The barcode is being generated through a class of a DLL downloaded from the internet. I need to change this bar code, but this class is blocked. How can I do a trick?
-
1
votes1
answer118
viewsMake a foreach that does not repeat the same data
I have this foreach, in a table with more than 5000 records. There are only 6 types of business unit. I would like that in the foreach and Ingl, when a type of UN appears, it loads and then does not…
-
1
votes1
answer175
viewsHow to create a popup with a dropdownlist?
How do I create a popup with a DROPDOWNLIST in Asp.net C# "MVC" or Javascript/Jquery ? You can call this popup through a ActionLink ?…
-
1
votes1
answer111
viewsActionresult Asp.net MVC methods
If I create a method like ActionResult with any name and give a re-turn to a View that I want to return something, will work normally or need to have the same name of View ? public ActionResult…
asp.net-mvcasked 9 years, 3 months ago AndreeH 1,333 -
1
votes2
answers2031
viewsProblems with types and conversions when filling a page
That is the mistake: An exception of type 'System.InvalidCastException' occurred in App_Web_fjskumyk.dll but was not handled in user code Additional information: Não é possível converter um objeto…
-
1
votes1
answer1376
viewsGet input value from a textbox in Asp.net mvc
How to get the new input value of a textbox by clicking the ? button update that would go to the bank.
asp.net-mvcasked 9 years, 3 months ago AndreeH 1,333 -
1
votes1
answer817
viewsCatch AD user Asp net mvc
Guys I have a question: how do I get the user logged into windows on the client machine? It’s getting the server user and not the client machine. Could you help me?
-
1
votes1
answer54
viewsLinq brings result but does not obey Join
We’re getting closer. With this code, it almost worked. Then I switched the Distinct() for DistinctBy() and did not repeat, but still not obeying the IDMotivo. What comes in Linnum does not match…
-
1
votes1
answer196
viewsHow do I put a Count in a string that returns a list
I need to make a count, for the following situation. See the image below, that I have repeated some pharmacies, see their CNPJ(066253003681 and 06626253001476). They are repeated because they are on…
-
1
votes1
answer416
viewsInjection of MVC dependency
Galera I’m using dependency injection to use the Mock. I wonder if I need to create an interface for my Model and one for my Controller? Thank you
-
1
votes1
answer46
viewsAsp Net MVC longPolling
I have a project Asp net mvc 5, verified that every second a request is made, passing these parameters = transport=longPolling&connectionToken="", and as an answer comes…
-
1
votes1
answer114
viewsUser property, utility and possible Displays
For educational purposes, I was observing the property User class Controller of Asp.Net MVC. I saw a example, very interesting, that a base class for the controllers has been implemented and it owns…
-
1
votes1
answer5901
viewsAlert/pop up message in ASP.Net MVC
How to create Alert or pop up to have the same effect as MessageBox in a web application? My code [HttpPost] public ActionResult NovaSolicitacao(Solicitacao pedidoSolicitacao) {…
-
1
votes1
answer306
viewsUrl.Action with routevalues and objects
I have the following Url.Action: @Url.Action("ActionName", "ControllerName", new { area = "AreaName" }) I also need to send some objects to this action through this Url.Action, how could I do that?…