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
-
5
votes1
answer1794
viewsOnly get user name in AD
With this code, I bring everything, Dominio/User. ViewBag.User = System.Security.Principal.WindowsIdentity.GetCurrent().Name; I would like to bring only the user name. I can take all this, and take…
-
5
votes4
answers8104
viewsHow do I make a connected Dropdownlist with a model property?
I have my class: public class Topico { public int Id { get; set; } public string Nome { get; set; } public string Observacao { get; set; } } and my Subtopic class public class SubTopico { public int…
-
5
votes2
answers1450
viewsSend Model Razor with $Ajax Serialized Controller
I’m trying to send an object to controller, using ajax. The object goes to the controller with Json, but recognizes only the values of get, not post. $.ajax({ type: "POST", url:…
-
5
votes1
answer239
viewsToupper() with accents
I own a string, where I wish to capitalize it, to standardize the information. I am using the ToUpper(). But when that string has accents the text gets shuffled. How to receive text with normal…
asp.net-mvcasked 9 years, 10 months ago Randrade 21,612 -
5
votes1
answer567
viewsUpdate page automatically when accessing system
I have a project, where I need the user to access the system, the system updates the page automatically, only once. I found how to do this from time to time( 5 in 5 seconds, for example), but I need…
asp.net-mvcasked 9 years, 9 months ago Randrade 21,612 -
5
votes1
answer1682
viewsCreate Roles to Hide/Show Menu
I’m developing my first application in Asp.NET MVC and now creating the restriction and authorization part of users. I would like to do this so that the menus of my application are only accessible…
asp.net-mvcasked 10 years, 4 months ago kLucas 199 -
5
votes1
answer411
viewsChanging a Dropdownlist via a search
I am creating a registration screen where in a text field I provide a search and the search result will have to appear in a dropdownlist. The project is asp.net mvc4 c# and the code in the view is:…
-
5
votes2
answers475
viewsIs it feasible to use more than one Dbcontext for in the same database?
I’m developing a new application on ASP.NET MVC and searching saw some examples of applications with more than one context. Let’s say my application has several different modules, but all entities…
-
5
votes3
answers10876
viewsRecognize duplicate items in a list
I’m getting a list of items in my action public ActionResult New(List<Itens> Itens) { return View(); } How do I recognize which items are duplicated on that list?…
-
5
votes1
answer844
viewsFormat date and time and list according to current date
This application has two tables: Students and Occurrences. To show the occurrences I can calmly... Only now I’ve come up with a new business rule: show occurrences by date. So basically it would be…
-
5
votes2
answers124
viewsHow I give a Sort on my dropdownlist
How do I give a Sort to my dropdown? This is my dropdown. How do I give a Sort to it? Calling to the Dropdown <select class="form-control col-sm-6" name="cbxCodTipo"…
-
5
votes1
answer1261
viewsAccess webcam to take photo
How can I have access to webcam to take some photo and upload directly to my server? Is there an API that helps me?
-
5
votes2
answers544
viewsProgress bar on file upload and information registration
I’m developing a project, where I upload files, as well as a record of information. Both the file and the information are registered in the same form. So far so good, but usually, when there are…
jquery asp.net-mvc asp.net asp.net-mvc-5 asp.net-mvc-4asked 9 years, 3 months ago Leomar de Souza 1,074 -
5
votes1
answer403
viewsHow do I maintain a Viewbag for all Controllers?
I am developing in ASPNET MVC 4 with Razor. I made the login page and everything is ok. After login, the famous phrase "Welcome FLAVIO" is being successfully returned, via Viewbag. As I’m doing a…
asp.net-mvcasked 10 years, 2 months ago Flavio 197 -
5
votes2
answers2885
viewsBlocked cross-origin request
Hello, I am trying to load a page from another application into a div of my application using the jQuery load but my application is not loading the page and shows the following error message:…
-
5
votes4
answers5763
viewsCapture Real User IP
How do I capture the actual Public IP/IP of the user accessing the application? The IP address of the computer I can capture normally, but I want to know the public IP address of this client.
asp.net-mvc asp.net asp.net-mvc-5 asp.net-mvc-4 asp.net-identityasked 9 years, 2 months ago Leomar de Souza 1,074 -
5
votes1
answer1567
viewsError using Viewbag in Dropdownlistfor ASP NET MVC
I have a Dropdown that lists the categories of my system, but when I submit the form without choosing a category, it gives a server error saying that the Value cannot be null. I put a validation…
-
5
votes1
answer76
viewsHow to block menu buttons, when a form has not been saved yet, is it possible?
I’m new around here. I’m starting in c# and came across the following question: I have a form, where I haven’t given a post still, and I didn’t want to let the user leave this screen without saving.…
-
5
votes2
answers676
viewsHTML element inside an Actionlink
Hi, I was wondering if it is possible to create an HTML element inside a ActionLink, for example: To create a link in a menu with ActionLink: @Html.ActionLink("Classificação Financeira", "Index",…
-
5
votes1
answer684
viewsIs it possible to use composite key for Entity Framework with Model First?
I have the modeling down and will need to map composite keys like the Embedded id of Hibernate, but in the Entity framework using the model first, it is possible ?…
-
5
votes1
answer1108
viewsWhy @Html.Checkboxfor returns "true,false"
In the construction of my View, I have a field of the kind: public bool? RegistoGesOleos { get; set; } Who I represent using Razor as: @Html.CheckBoxFor(model => model.RegistoGesOleos.Value) Now…
-
5
votes2
answers506
viewsReceive null int in Razor (@Html.Textboxfor)
I have an object Carro and I have a whole-type, annulable property called AnoInspecao. When creating, I can create a car object with the year of null inspection (without typing anything) and persist…
-
5
votes1
answer795
viewsGood practice with . NET MVC
I have an ASP.NET MVC application and would like to know what good practices microsoft indicates in the organizational aspect of the solution, using the latest technologies such as ASP.NET Identity.…
-
5
votes1
answer4598
viewsGenerate Danfe from Nfe XML
I’m developing an application ASP.NET MVC with C# and need to transform XML from NF-e to Danfe in PDF, someone knows some component to it?
-
5
votes2
answers1283
viewsSELECT 3 different tables using DAPPER?
First I would like to say that I am a beginner in programming, and I am in developing my first project. Using ASP.NET MVC Technology. I need to make a query in 3 different tables: User, Parents and…
-
5
votes1
answer276
viewsHow to use Format: Webgrid?
I am developing with MVC, and I have the List view [...] var columns = new WebGridColumn[] { grid.Column("Id"), grid.Column("Descricao"), grid.Column("UsuarioModificacao"),…
-
5
votes1
answer186
viewsASP NET MVC standard
I am learning ASP.NET MVC and would like to learn about design patterns, I have a lot of doubt on how to assemble my Solution. I would like to know the default names for Solution, folders, layers,…
asp.net-mvcasked 8 years, 7 months ago Mauricio Ferraz 2,074 -
5
votes3
answers612
viewsHow to leave empty textbox after an Ajax request via Post?
I have a registration application in . net MVC and I am using Ajax to send the contents of the Forms For my Action that registers, when save the value of the fields, in my view the values are still…
-
5
votes1
answer570
viewsWhat is the difference between Ajax.Beginform and Html.Beginform in Asp.net MVC
Working with web inasp.net mvc, I saw that it is possible to use Ajax.BeginForm() and Html.BeginForm(). What is the difference between the Ajax and that of Html?…
-
5
votes2
answers780
viewsMulti-tenant system with the possibility of "customization"
I am raising knowledge for the creation of a multi-tenant system. I’ve been taking a look at some references from MSDN, SOEN and SOPT, as well as several websites. Although I have read the…
-
5
votes1
answer356
viewsHow to change the template(visual) of an Asp net mvc5 page according to user
Here’s the thing, I need to read a property that returns me 1,2,3... and with it I determine what kind of visual the page will have, template01,template02... how I would do this using areas, and…
-
5
votes1
answer777
viewsData formatting works on Chrome and does not work on Internet Explorer, or vice versa, with MVC C#
If I wear the model [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:dd'/'MM'/'yyyy}")] public DateTime data { get; set; } Works perfectly on I.E. but doesn’t work on Chrome. When…
-
5
votes2
answers543
viewsHow to organize the return of data in a List<T>?
I have a wcf that returns me some information, I would like to bring them organized, how could I do it? I’d like to return data like this: At the moment it’s like this: I’m doing like this: public…
-
5
votes2
answers305
viewsOnly constructors without parameters and initializers are supported in LINQ to Entities - Asp.Net MVC
I’m developing an application that manages courses. The student, when entering the registration screen and clicking on the "registration" button, is associated to a course, that is, is enrolled. So…
-
5
votes3
answers11042
viewshow to Fill a Dropdownlistfor
Could someone help me how do I fill one DropDownListFor? Before I was doing it this way: @Html.DropDownList("lstAffiliate", string.Empty); But I saw that it was not recommended, then I decided to do…
-
5
votes1
answer679
viewsDoubt with mvc list editing, using checkbox and editable field
I’ve got a lot of doubt and I barely know where to start, so I’m going to go to college: I have a page cshtml (I’m using Asp.net-mvc). It has a list, assuming that the elements are A, B, C, D, E.…
-
5
votes3
answers119
viewsWhy declare property twice in one class?
When declaring a property in one class, they usually declare twice, one public and the other private. What is the purpose? private int _years; public int Years { get { return _years; } }…
-
5
votes2
answers83
viewsDesign based on the VS2015 spa template. How the service is generated
I created a project using the SPA template in Visual Studio 2015, to learn and understand, but I found this example very complicated. I still don’t understand where the service is mounted and…
-
5
votes1
answer1081
viewsHow to call Procedure using Asp.net MVC with Entity Framework
In an application Asp.net mvc, using ADO.NET with Entity framework and mysql, I have a procedure, that returns a listing. CREATE PROCEDURE SP_CATEGORIAS() BEGIN select * from (select a.id,…
-
5
votes2
answers296
viewsHow to make a LINQ/lambda and consume it in the view?
I have an object called Radio: public class Radio { public int RadioId { get; set; } public string StreamUrl { get; set; } public bool Ativo { get; set; } public bool Mp3 { get; set; } } I’m doing a…
-
5
votes3
answers2406
viewsAccess content from another project in the same Solution
Here’s the thing: I have a Solution with two Projects, one Administrative and one Website, both using C# and MVC4. In the first project I save images and files in a folder Documents, and when…
-
5
votes1
answer3473
viewsHow to publish website made in Visual Studio?
I created a MVC site in Visual Studio 2017. I want to know how to generate the necessary files for the site to work and in which folder I should include them.
-
5
votes2
answers1857
viewsOSI error when published application
When I publish my application, the following error appears: This Operation requires IIS Integrated pipeline mode. Description: An unhandled Exception occurred During the Execution of the Current web…
-
5
votes2
answers2359
viewsPassword encryption
I have an Asp.Net MVC project and would like to securely store users' passwords in the bank. The goal is to create something that cannot be easily decrypted in a few hours of brute force on a PC (I…
-
5
votes1
answer773
viewsWrite include date using Entity framework
I believe there was a misinterpretation, I’m posting the code to be better understood. I am using a project for my EF Repository is inside it I have: Note the doubt in //companySalvar.DATA_IND =…
-
5
votes1
answer233
viewsHow to test an Asp.net mvc controler using Moq and Entity Framework 6
My controller: [Authorize] public class DominioController : Controller { private IDominioDB _db; public DominioController(IDominioDB db) { _db = db; } // GET: Dominio public async…
-
5
votes2
answers145
viewsChild references and service Pattern
A widely used Pattern in DDD, is the service pattern. My question is, where is the logic for references "daughters"? For example, a use case, Pedido who owns Produtos public class Pedido { public…
-
5
votes1
answer128
viewsUse of Dataannotations in DDD projects
We are with a doubt that analyst raised, when I use Dataannotations in Viewmodel in projects that use DDD in the case have a Domain layer and in the case will not expand, this use would eliminate…
-
5
votes1
answer688
viewsHow to publish an MVC 5 site?
I made a subscription to Godaddy and I’m having doubts to publish the project. Currently in the root directory of the site contains only one HTML page: index.html, as we can see below. index.html:…
asp.net-mvcasked 9 years ago hard123 2,329 -
5
votes2
answers3367
viewsWhat are the differences between Viewbag, Viewdata and Tempdata?
I was researching how to pass data to a view, or rather, persist the data of a controller to the view. I would like to know among the 3 forms cited in the title: What are the differences between…