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
-
6
votes3
answers1233
viewsHow to login to desktop application via web application?
I have a web application developed with ASP.NET MVC and log in by storing the data in Session. I have another application, however desktop, that performs some tasks that cannot be done on the web,…
-
6
votes4
answers4566
viewsHow do I update my data in the table using the Entityframework?
var contactado = ContactadoRepositorio.ObterListaContactadoPorCodigo(procedimentoVM.CodContactadoPessoa); //obtenho o contactado pelo id obtido; foreach (var c in contactado) { var contactadoPessoa…
-
6
votes2
answers174
viewsHow in ASP.NET 5 is this property defined?
In ASP.NET 5 in the method Configure class Startup we can receive in the parameters a reference to an object whose class implements IHostingEnvironment. One of the properties of this class is…
-
6
votes2
answers878
viewsMVC Ioc Builder without parameters
Hello. My application is triggering an error while trying to create a new item. I’m getting this error message: No constructor without parameters has been set for this object. But my controller…
-
6
votes3
answers130
viewsHow to implement methods in Json using Serializable?
I’m making a webservice where I want to return the data in JSON, how I could implement the methods, which is the best way? GET PUT DELETE POST I did a GET method, it went like this: using System;…
-
6
votes2
answers475
viewsWhat is the purpose of automatically generated directories in an ASP.NET MVC project?
In Visual Studio Community 2015 when we create a new project in ASP.NET MVC in the project is automatically generated the following directory structure, see the image below: Being in total eight…
-
6
votes1
answer522
viewsEntityframework 6 + Lazyloadingenabled + using()
I need a help. My problem is this: I cannot return my object items. Follow my code for analysis. Client class public partial class Cliente { public Cliente() { this.ClienteEndereco = new…
c# asp.net-mvc entity-framework-6 lazy-loading repositoryasked 9 years, 6 months ago Henrique Abreu 379 -
6
votes2
answers565
viewsWhat are ASP.NET MVC routes?
In ASP.NET MVC always appears to me the term route when I read something related to this technology, however, I started studying APS.NET MVC recently and this term route is causing me trouble.…
-
6
votes1
answer185
viewsWhat is Level Trust of an ASP.NET application?
What is the purpose of setting up Level Trust in an ASP.NET application? It protects the server from something? It protects the application from something? In which case or for what reason it is…
-
6
votes2
answers1515
viewsData Displayfor display formatting
I have a field in the database, Date Time, and wanted to display on screen to the user, but in separate fields, being Date and Time. First displays the Date @Html.DisplayFor(modelItem =>…
-
6
votes3
answers1227
viewsIs there a Data Annotation that prevents data duplication in the Database?
How do I prevent data from being duplicated in the database using Data Annotation or via another validation?
-
6
votes1
answer728
viewsAjax in different project
I have a project in Asp.Net MVC with the following method: public ActionResult ObterCursos() { List<curso> cursos = new List<curso>(); curso curso_ = new curso(); curso_.Nome =…
-
6
votes3
answers4902
viewsHow to load a dropdown with a selected value
I have a method to make changes in some data. Among these data, I have a dropdownlist which contains course periods. When I select to change, I need the dropdown comes with the option checked, as it…
-
6
votes1
answer289
viewsDropdown filter using C# MVC 4
I have a dropdown in my view that I fill in the following way: ViewBag.NfeStatus = EnumHelper .ListAll<NfeStatus>() .ToSelectList(x => x, x => x.Description()); My model Nfestatus is an…
-
6
votes1
answer94
viewsWhat is Accelerated Mobile Pages (AMP)?
By chance I ended up reading on an administration portal where I talked about digital marketing trends for the year 2017 and what caught my attention the most was the AMP. Which led me to the…
-
6
votes2
answers3207
viewsWhat are the differences between ASP.NET MVC and ASP.NET Razor Pages?
What are the differences and limitations between ASP.NET MVC and ASP.NET Razor Pages? I was very curious, because apparently the Razor Pages use the MVC standard, but without the need to use a…
-
6
votes2
answers663
viewsWhere to create a Helpers layer?
I need to create a layer Helpers which will contain classes that will be made available for the entire project. These classes will contain functions such as calculations, wipers of string, anyway,…
-
6
votes3
answers647
viewsAuthorization of users to actions using the Authorize attribute
I put the [Authorize] in my controllers and I inserted this code: <authentication mode="Forms"> <forms loginUrl="/Login/Login" /> </authentication>` For whenever the 401 code…
-
6
votes3
answers155
viewsHow to test Filters that verify Claims data?
I own a ActionFilter for some controllers and actions that make use of the user information that are in Claims. The filter itself obtains information from Claims user and executes the authorization…
-
6
votes1
answer406
viewsAuthorization in Asp.Net MVC
I’ll try to be clear. In most examples of ASP.NET MVC authentication and access authorization, I see that authorization control is usually done on Controller, with the decoration of the class itself…
-
6
votes1
answer1327
viewsCan’t find Httpcontext.Current
I’m trying to create a Urlhelper as follows: UrlHelper urlHelper = new UrlHelper(HttpContext.Current.Request.RequestContext); I already made the reference to System.Web, as I saw as solution in…
-
6
votes1
answer170
viewsGenerate new Migrations based on all models
I need to create an Migrations with all the models created (I ended up deleting the first Migration and I am not able to create the authentication database).
-
6
votes1
answer185
viewsQuery Linq and see index
He wanted a query in Latin that shows the attributes of the availability table and the name of the respective catechist that is in the person table. At index will appear: Nome | AnoPastoral |…
-
6
votes1
answer633
viewsReturn data as JSON using ASP.NET MVC
When developing a web application, using ASP.NET MVC, I need to return the layer of view, data as JSON in the following format: { 'title': 'Gallery 1', 'description': 'Description of gallery...',…
-
6
votes2
answers163
viewsWhat do these question marks mean?
What do the question marks on that get. What do they mean int? and ?? in this line of code, I have already found examples that used ? and ?? but never so many in a single line and this gets a little…
-
6
votes1
answer5562
viewsDisplaying message in a view through the C# MVC Controller
looking for a solution I found a way in the link Controller message to view But my problem is that nothing is shown. I don’t know if it’s because I don’t have an action in the View but the message…
-
6
votes1
answer325
viewsRun Insert in Migrations Entity Framework
I am developing an ASP.NET MVC project with Entity Framework Code First. I already checked the bank and managed the first Migrations, my question is: has how to execute a insert right after creating…
-
6
votes2
answers2059
viewsUpload Image Asp net MVC
My question is this: imagine a scenario where I have a canvas that has a form, and in this form also exists upload images. Let’s assume that I fill out the entire form, and select 3 images in the…
-
6
votes1
answer1792
viewsGenerate and download pdf file
Is there any specific configuration to generate pdf file on the server ? The problem is that locally in my local project works perfectly and when I go up to the server the file is not generated, the…
-
6
votes3
answers1767
viewsAttribute in Dataannotations for Currency
I would like to format with Dataannotation currency but standard in the model: [Column("cur_mensalidade")] [DataType(DataType.Currency)] [DisplayFormat(DataFormatString = "{0:C0}")] public decimal?…
-
6
votes3
answers1530
viewsSend file and text via jquery Asp.net mvc
Guys I managed to send the file through this code: var jqXHRData = null; $(function () { $('.progress').progress({ percent: 0 }); $("#divUpload").on('click', function () {…
-
6
votes1
answer4187
viewsHow to implement Automapper 5.0.2
I set up a project a while back, as follows, A Class called Automapperconfig as follows: public class AutoMapperConfig { public static void RegisterMappings() { Mapper.Initialize(x => {…
-
6
votes1
answer6325
viewsProblem with Nuget Packages Visual Studio
Trying to compile the application, I come across the error: Severity Code Description Project File Line Suppression State Error This project References Nuget package(s) that are Missing on this…
-
6
votes2
answers1675
viewsTranslating Identity in English
I’m using the Identity on my application MVC 5.2.3 Microsoft.AspNet.Identity.Core 2.2.1 also installed the translation package of the same Microsoft.AspNet.Identity.Core.pt-br 2.2.1…
-
6
votes3
answers1299
viewsShould every table have Primary key?
I believe my question is both conceptual and technical. My whole problem started when I made an SQL Server database and in it there were some tables without primary key, such tables would serve…
c# asp.net-mvc sql-server entity-framework entity-framework-6asked 5 years, 5 months ago Nelson Francisco 147 -
5
votes2
answers961
viewsHow to redirect from non-www to www?
I want my website visitors to always access with www. I want to somehow redirect in case the user tries to enter without www or Ubdomain. If you try to access exemplo.com I want to redirect to…
-
5
votes2
answers879
viewsHow can I prevent a user from submitting the same form multiple times?
I have a form on a page, sometimes users can double-click the button to submit the form... The form is a @using (Ajax.BeginForm(...)) { } How can I prevent that from happening?…
-
5
votes1
answer190
viewsParameter for Stored Procedure not identified
I’m having a problem, which would be a mistake saying that there is no parameter being passed to the Procedure. It is running the following code: cmdProcedure.Parameters.AddWithValue("@id", 0);…
-
5
votes1
answer372
viewsHow to resize thumbnails generated by Uploadfy? ASP.NET c# MVC 4
Hello, I would like to know how to resize the thumbnails generated by jQuery Uploadfy plugins. As shown in the print below, it generates the thumbnails according to the actual size of the images, it…
-
5
votes5
answers2481
viewsDo not allow saving duplicate records
I am developing a system using ASP.Net MVC and Entity Framework. How do I not allow equal data to be recorded in a table? For example, don’t allow login: x to be registered more than once.…
-
5
votes1
answer275
viewsChange banner every page refresh
I have a list of 3 Banners. I must always show each one different Refresh of Page, even after closing the browser. I’m thinking about doing a fingerprint counter every time a Banner and shown adds +…
-
5
votes1
answer303
viewsMultiple types of authentication
In my system I need to have two types of authentication one for common user who will register and etc.. and another for the administrator my question is how I differentiate the two authentication…
-
5
votes3
answers2113
viewsApplication that does not need to load full page
How can I create an MVC C# with Razor, where I have a Layout and then just update the central content and not the page as a whole. I read some places to use AJAX another to use PartialView. But what…
-
5
votes2
answers318
viewsIn an architecture, does the number of Dlls influence performance? Scalability?
I have the habit of creating my Solution like this: Entity - Class Library (Classes, entities) Utils - Class Library (Classes of support, security, generate xml, in short, all kinds of functions)…
-
5
votes1
answer761
viewsHow to implement an update LOG with ASP.NET MVC?
I would like ideas on how to implement a generic update LOG in DB (Entity Framework 6+) that allows me to discover information such as: System X user at date Y changed name and date of birth (from,…
-
5
votes1
answer1157
viewsIn a checkbox list, know which ones are checked
In my application I am printing a list of data coming database, and in each item of the list I am placing a checkbox, as shown in the following picture: Now by clicking "Start copy" I want to select…
-
5
votes1
answer1029
viewsSave automatically generated excel in ASP MVC application
I am generating Excel files in my application using Epplus. Now there is a need to automatically store these files in a folder, regardless of whether the user downloads them or not, in order to make…
-
5
votes1
answer704
viewsDatetime field view in View without part of Hours
With the code below I am recovering the Datetime with time past the date, what I would not like. cursos.Data = DateTime.Parse(collection["Data"]); I tried to format using substring inside…
-
5
votes4
answers1684
viewsDynamically check which attributes of a Model have been changed?
I am developing an ASP.NET MVC 4 application and need to save the log of each change made in a Model object. Is there any native method or implementation already known to do this? Example: public…
-
5
votes1
answer1220
viewsSend "@Html.Beginform" to another area controller. Asp.Net
I own a controller in a Area calling for "LoginProfessional", with the actions Index, Logon, Logoff. I make a RenderPage calling for the Index in Area root of the project, but when I click on the…