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
-
3
votes2
answers1744
viewsHow to change the name property in @Html.Editorfor
I have the following class: public class ModelHome { [Required] [Display(Name = "Nome")] public string Nome { get; set; } [Required] [Display(Name = "Email")] public string Email { get; set; }…
-
3
votes1
answer186
viewsHtml.Beginform() No Submits model, Modelstate.Isvalid = False
Next I am with Html.Beginform() where the same Submits the model however when it goes to the control it is false the Modelstate.IsValid. Follows Model, Control and Beginform Model:…
-
3
votes1
answer497
viewsEntity Framework Migration - Indicate migrations as executed
I am working on an ASP.NET MVC system with Entity Framework, which uses Migrations. Has the following initializer: public void InitializeDatabase(Contexto context) { if (!context.Database.Exists())…
-
3
votes1
answer291
viewsWhat’s the Context class for?
I am developing a system in ASP.NET MVC with mapping using the Entity Framework, when observing some patterns I see a lot the use of the class Context, what it’s for and what it should contain…
-
3
votes3
answers4226
viewsPersist information using Viewbag?
I have my screen login is to show the name is id of the logged in user on another screen, so I can use this information. In my controller: [HttpPost] public ActionResult Index(TB_USUARIO model) {…
-
3
votes1
answer42
viewsDoubt with version of Aspnet.Mvc
In my Packages.config I have the following settings: <?xml version="1.0" encoding="utf-8"?> <packages> <package id="bootstrap" version="3.0.0" targetFramework="net45" />…
asp.net-mvcasked 8 years, 10 months ago Harry 3,805 -
3
votes3
answers279
viewsRegular expression to ignore quote separator
I have to read a csv file with delimiter ;. Only it has lines with values """Analize;Distribuição""", only that it creates another column in this ;. How can I read so he won’t accept ; in quotes as…
-
3
votes1
answer756
viewsLoad updated page using method get jquery mvc Asp.net
I have a demo page where I organize a to-do list.. wanted that when it relapses it already comes updated with the tasks already posted previously <html> <head>…
-
3
votes1
answer931
viewsHow to configure routes when the application is not at the root of the Asp.net mvc server?
Locally my site has the following default route is everything works: using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using…
asp.net-mvcasked 8 years, 10 months ago Harry 3,805 -
3
votes2
answers603
viewsASP Classic runs on ASP.NET server?
I have a site all made in ASP Classic and hosted in a provider. My client - who is a multinational - wants to put their website inside the company’s global server and the guideline that came out…
-
3
votes0
answers533
viewsIIS configuration to authenticate using Active Directory
I created a web system using C# and use a routine to authenticate the user by taking the Active Directory user. However my system is not getting the AD user: it is catching the user from pool of the…
-
3
votes3
answers833
viewsJquery modal does not open
I’m trying to implement a modal, but I’m not getting it open, someone could help me. <script src="~/Scripts/jquery-2.2.0.js"></script> <script…
-
3
votes1
answer322
viewsProblem saving checkbox text value to my database
You wanted to save the days of the week selected by the user, storing the contents of the label as string. What comes to the controller when I select all checkboxes Domingo false Segunda-Feira false…
-
3
votes1
answer737
viewsHow to create an application from scratch in ASP.NET MVC?
I’m studying about the Asp.Net MVC and here I already got a good base of how to start from scratch with Empty, as I haven’t found a good tutorial on how to start. My problem is this: I have this…
-
3
votes1
answer158
viewsStore List<Menu> In Memory or Cookie
good afternoon. I have an application that has a whole level of permissions management of access to pages and a number of other settings. Whenever a user authenticates, I assemble a list of all the…
-
3
votes3
answers1650
viewsSend All Checkbox via Post
I’m trying to send all my View Checkbox, however, I can send only those selected via Formcollection Controller public ActionResult Index() { List<ListaCheckBox> listacheck = new…
-
3
votes1
answer81
viewsLazyload even putting . include(t => t.Model)
I’m having the mistake: Exception Details: System.Objectdisposedexception: The Objectcontext instance has been disposed and can no longer be used for Operations that require a Connection. When I…
-
3
votes1
answer269
viewsHelp with Action Edit and Delete returning null
I am developing an application but I have a problem with Edit and Delete actions. I have looked at the code several times, but calling the cited actions shows the following error: The Parameters…
-
3
votes1
answer306
viewsReceive post from one view to another view
I have two Views. Index Assincrona When access to index, he calls the View Assincrona and there’s a gif uploading to the whole page (Assincrona) be loaded and displayed in View. Controller Codes…
-
3
votes3
answers720
viewsDropdownlistfor how to use?
I’m having a question on how popular and then pick up the selected item from a DropDownListFor, I am using DDD architecture and Entity Framework. In case here my class ServiceProviderViewModel has…
-
3
votes1
answer100
viewsShow data from multiple models in the view
I have the following problem: In a view I will show data from 8 different tables and I have the following code that I put together to take the data to the view. public ActionResult Index() { var…
-
3
votes2
answers167
viewsView with Ienumerable and Entityframework
I own a Sales entity and it has several fields (Iditem, Datavenda, Valorvenda, Taxadesconto, Idcliente, Idcategorito and etc). I already have all Views working for this entity(CRUD). Now I will…
-
3
votes2
answers940
viewsFile import and read
I have an Asp.Net MVC project with Entity Framework 4 and SQL Server, where there is a Action who receives via POST an archive csv. Taking into account the use of memory, processing time and…
-
3
votes1
answer87
viewsHow to refresh the context? ASP.NET
I’m starting to develop in ASP.NET and always have a small problem. When I need to generate a context (That class that will reference with the database), example below: I do the following procedure:…
-
3
votes1
answer98
viewsReturning the values of a model dynamically in . NET MVC
I have an authentication class that stores the user ID in a session, which receives the model name corresponding to the current user, for example: users, admins, clients. Example:…
-
3
votes1
answer82
viewsIs it bad practice to cache an entire Model on IIS?
In an application I use sixteen times a code like var cliente = db.Clientes.Find(id); So that’s why I created a controller that returns me: [OutputCache(Duration = (10 * 60 * 60), VaryByParam =…
-
3
votes2
answers1083
viewsFields in the same line MVC5 Application Bootstrap
I would like a tip on how to put two fields on the same line in Razor, using bootstrap in an ASP.NET MVC5 application. div class="ibox-content"> <form role="form" class="form-inline">…
-
3
votes1
answer648
viewsHttpcontext.Current.Session - Null
By a business rule of the project, whenever an object of the type ViewModelBase is instantiated, I need to perform some user profile validations to define which buttons the user will have access to…
-
3
votes1
answer46
viewsHow to render 2 typed view from different controllers
How do I render 2 view typed of controllers different? Controller: public ActionResult Index() { Cliente cli = new Cliente(); cli.Nome = "Al Unser"; return View(cli); } Index: @model…
-
3
votes1
answer492
viewsCreating Models that derive Identityuser or use the Aspnetusers table
I am developing management software for my gym. I have Students, Teachers and system users. I installed the Identity. I created a model calling for Aluno who inherits from the IdentityUser public…
c# asp.net-mvc entity-framework modeling asp.net-identityasked 8 years, 2 months ago Dorathoto 7,426 -
3
votes1
answer455
viewsPass Datatime javascript to ASP.NET MVC Controller by Ajax
I’m having trouble passing date of javascript to the Controller via ajax.. Model: public class ModelA{ .... [Required] DataType(DataType.Date)] DisplayFormat(DataFormatString = "{0:dd/MM/yyyy}")]…
-
3
votes1
answer101
viewsSend email without it appearing in the mailbox
I don’t want those items sent in the real estate email. string emailOrigem = imobiliaria.Email; string password = imobiliaria.Senha; string html = getBody(dados); //aqui serve pra formata o html if…
-
3
votes1
answer76
viewsFunction that returns other functions
I have three methods being called separately on controller with JSON. Each one of them returns to me Id Name. I need to call these three methods in the same function in the controller. How can I…
-
3
votes3
answers3825
viewsLimit for sending files
I have a project in Asp Net MVC . NET Framework 4 as follows: View: <div class="file-content"> <label class="custom-file-upload"> <input type="file" id="importar-arquivos" multiple…
-
3
votes1
answer438
viewsStoring multiple values of an Enum in the database
I wish I could save several options of an Enum (day of the week) something like 1,3,5 (Monday, Wednesday, Friday) As modeling described here. I created a model public class Horario { [Key] public…
-
3
votes1
answer471
viewsDoubt with Time Asp.net mvc
I have a timer that I am testing and the same returns me an error: An Exception of type 'System.Web.Httpexception' occurred in System.Web.dll but was not handled in user code Additional information:…
-
3
votes1
answer56
viewsI cannot load a View after calling $.post
I am passing the parameter below (client), from a jQuery function to a Action, through the command $.post (as shown below). The parameter arrives correctly in my action, but I cannot return to View…
-
3
votes2
answers147
viewsHow to give a "refresh" after updating the new video?
In my view, I have an old video, when I "upload" new video, want to automatically reload a new video after "upload". Follows the code View: <div id="embed_video" class="embed-responsive…
-
3
votes2
answers371
viewsWorking with Seed + FK Method
I’m finding it difficult to work with the method Seed, Because I register the state, and right away I wanted to register the cities, and then I can’t reference the state in the city, what could I…
-
3
votes2
answers220
viewsInheritance problem
I have a problem with a bank search, I will try to explain in the best possible and clearest way. I have a table Pessoa and a table Cliente, the last inherits from Pessoa, I also have a table…
-
3
votes1
answer325
viewsHow to call a View by passing parameters through json
I have this code that passes parameters to my controller: var id = $(Musico).val(); var url = '@Url.Action("Votar","Chamada")'; var tipo = 1; $.ajax({ url: url, data: { id:id, tipo:tipo } }); my…
-
3
votes2
answers206
viewsWhere to place the View Model rule
I need to create a View Model to use on the screen. I’m wondering where to put the button rule be enabled or not. I thought about this implementation, I would like to know if it is the best way.…
-
3
votes1
answer763
viewsHow to Save Files to Separate Server by Extension
I have a WEB API who receives a file via POST follows the code of Controller: public async Task<HttpResponseMessage> Post() { // Ver se POST é MultiPart? if…
-
3
votes1
answer198
viewsAuthorizeattribute in Controlller and Actions
When using an attribute (Authorizeattribute) developed by me (with use of Enums) it is not working as it should as follows: When used to memorize the Controller statement:…
-
3
votes1
answer177
viewsHow to integrate Tinymce with ASP.NET MVC
Implementation of the TinyMCE in ASP.NET MVC I found a problem when realizing image upload. The way I’m trying to implement is the following: I have a View with the Script who calls a Controller…
-
3
votes1
answer102
viewsjquery Intellisense does not work in VS2015 Community
I can’t make it work at all. Man _references.js /// <autosync enabled="true" /> /// <reference path="bootstrap.min.js" /> /// <reference path="jquery.mask.min.js" /> ///…
-
3
votes1
answer485
viewsPass the (integer) Return from a Controller method to the View
I have this method in a controller: int GetSpot() { List<CompanyDetail> topCompanies = GetTopCompanies(); CompanyDetail topCompany1 = topCompanies.Where(x => x.Company.TopCompany ==…
-
3
votes2
answers76
viewsEntityframework Aspnet Core Migrations
Good evening, I came across a problem to update the DB of an Aspnet Core application. Had created the bank, but ended up deleting, now, while trying to create again using the following commands:…
-
3
votes2
answers649
viewsProblem with connection between EF and Postgresql
I am trying to make a connection with EF and Postgresql in an Asp.Net Mvc application I am using the following references Entityframework6.Npgsql Npgsql 3.1 .NET Framework 4.5 I have the following…
-
3
votes1
answer4100
viewsThe ADO.NET Provider with invariant name 'Mysql.Data.Mysqlclient' is either not Registered in the machine or application config file
I have an MVC project, and I wanted to connect to the Mysql database. I put this connectionStrings. <add name="Contexto" connectionString="server=127.0.0.1;User…