Most voted "asp.net-mvc-5" questions
This tag should be used when the question refers to some features only available in version 5 (currently the latest) of ASP.Net MVC. ASP.NET MVC is an open-source Microsoft framework that implements the Model View Controller architecture standards for web development. Based on ASP.Net, allows software developers to build web applications following the Model View Controller architecture standards.
Learn more…937 questions
Sort by count of
-
1
votes1
answer804
viewsInclude Problem in Entity Framework
I have the classes: public class Estado { public int Id { get; set; } public string Nome { get; set; } public string Uf{ get; set; } public ICollection<Cidade> Cidade { get; set; } } public…
-
1
votes1
answer64
viewsAutomated Deploy - Multi-customer version maintenance
How best to automate deploy ? Having 1 deploy for each client, what is the easiest way to maintain all these deploys ? Database Migrations and all version processing? In an example you have 100…
-
1
votes1
answer275
viewsHow to maintain a Session after re-running an application?
In my MVC 5 project, a session with the user data is created in the login and after the re-execution of the application the Session no longer exists, however, the authentication Coockie still…
-
1
votes1
answer56
viewsBower at Visual Studio 2015
I downloaded Visual Studio 2015 Community and went to test to see if everything was OK. But it is not, when I create an ASP.NET MVC 5 web project, the Bower.json file does not 'offer' Intellisense…
-
1
votes2
answers15582
viewsWhy does the background-image url search for the image inside the Content folder?
I have a CSS like this: #hero { height: 100%; background-image: url("~/img/bg-img.jpg"); background-position: top center; padding: 0; overflow: hidden; } When I rotate, the image does not appear,…
-
1
votes1
answer191
viewsProblem with select in table with relationship Many to Many
I have the following scenario: public class Pedido { [Key] public int Id { get; set; } public virtual ICollection<ProdutosPedido> ProdutosPedidos { get; set; } public DateTime CreateDate {…
-
1
votes1
answer792
viewsHow to add item in an order in Asp.net c#?
I am developing a project that asks that items from a pizzeria be added to an order, not being a shopping cart, generating the order as if it were a cashier program. I don’t know how to add items to…
-
1
votes0
answers154
viewsThe number of generic arguments provided is not equal to the aridity of the generic type definition. Parameter name: instantiation
I am having a problem developing an application in Asp.net MVC with IOC, Automapper and all other screens work perfectly, just not that of Drivers. couldn’t identify the mistake, could you help me?…
-
1
votes1
answer344
viewsIIS Validation Messages - Asp.Net MVC
I published my application on IIS, however, the validation messages are appearing in English. I already installed the Asp.Net MVC package in English in the link…
-
1
votes2
answers1078
viewsSite works on localhost, but not on Uolhost (permissions?)
I created a standard site (those that already come pre-encoded from visual studio 2013), using Asp.net mvc technology with common authentication by individual accounts. On my localhost the site runs…
-
1
votes1
answer233
viewsUpload _Layout.cshtml information from database
I want to upload the information to _Layout.cshtml as registered in the database, for example, @ViewBag.MetaDescription, @ViewBag.MetaKeywords, @ViewBag.Title and other information also from the…
asp.net-mvc asp.net-mvc-5 razor entity-framework-6asked 8 years, 6 months ago Alexandre Rodrigues Alves 11 -
1
votes1
answer2055
viewsHide URL parameter in MVC 5
My question is this:: How to hide the URL ID parameter using routes or mask? PessoaFisica/Edit/1 for PessoaFisica/Edit routes.MapRoute( name: "Default", url: "{controller}/{action}/{id}", defaults:…
asp.net-mvc-5asked 8 years, 4 months ago Daniel 53 -
1
votes1
answer125
viewsCoordinate in MVC map
I need to show a map to the user and allow him to choose a location. After choosing the location I need to return the GPS coordinates (Latitude, Longitude) to the action. What’s the best way to do…
-
1
votes2
answers355
viewsMaintenance page ASP.NET MVC
I have an ASP.NET MVC site that when it goes into maintenance I need to display a maintenance page, ASP.NET MVC has some possibility to do this just by changing a key on Web.Config or something…
-
1
votes0
answers64
viewsMiniprofiler error Asp.net mvc 5
I’m trying to use the Mini-profiler I made the following configuration: PM> Install-Package MiniProfiler PM> Install-Package MiniProfiler.MVC4 (According to the Doc also attends the MVC5)…
asp.net-mvc-5asked 9 years, 11 months ago Rod 9,412 -
1
votes2
answers91
viewsVisual Studio 2015 - Team Fundation - Erro projeto Asp.Net MVC
Someone is having trouble moving up an ASP.NET MVC project to Team Fundation? What happens is, I do the up, but when I run on another computer, it starts giving referencing errors not found I…
asp.net-mvc-5 visual-studio team-foundation-serverasked 8 years, 1 month ago Thomas Erich Pimentel 3,059 -
1
votes1
answer1071
viewsHow to use different CSS files for each view
I wonder if it is possible to be using CSS files "helpers". For example, in my ASP.NET project MVC 5, as everyone knows, and default the use of BootStrap, but it would have to create a separate .…
-
1
votes2
answers2406
viewsGeneration of Logs with Nlog?
I’m using the Nlog, and for each client logged into the system I would like to create a log generation behavior as follows: [nome-cliente-1]-[dataAtual].txt [nome-cliente-2]-[dataAtual].txt Ex:…
-
1
votes1
answer642
viewsConfirmation of data Registrations E-mail Password
would like to know the best way to validate E-mail and password, to check if the user has typed the information correctly. Ex: Enter your e-mail address: Confirm your e-mail address: Enter your…
-
1
votes2
answers477
viewsView Ocutar Password using Editorfor
I’m using Labelfor, I wanted when clicking above to enter the password, displayed the characters, and when clicking outside was hidden, how could I do? <div class="form-group">…
-
1
votes1
answer287
viewsMVC Helper Menu
I’m having some difficulty in assembling a Helper to assemble the system menu This is my view @model…
-
1
votes2
answers3152
viewsremove mask to save to database
I am using Maskmoney to create a mask in the field for the user to type. wanted to remove the mask, saving only the numbers and the comma (2 decimal places) in the bank. R$ 1.300.000,00 saving only…
-
1
votes1
answer247
viewsEditing content from Div
I have a index, that displays the data from my database, wanted to click on the div, open a modal, which allows changing that div. Code of view: <div style="float:left;…
-
1
votes0
answers866
viewsHow to list data with Inner Join with mvc 5, c#, Dapper, and sql server?
I’m having the following difficulties: 1 - Data display from a select with Inner Join. The fields of the other tables do not appear all that are in select, and the ones that appear, have the value…
-
1
votes1
answer656
viewsFill in a Dropdown (Select)
I need to create a select In this pattern: <select id="Cidades"> <option></option> </select> Where the user will select its state, and then a jquery will be made that…
-
1
votes3
answers1667
viewsAvoid duplicated list data
I need a list of musicians without repetitions, however it is bringing duplicate values, according to the amount of songs that each Musician has, how do I to be brought only one Musician? public…
-
1
votes1
answer124
viewsIF condition in javascript only works once
I’m trying to make a Side Navigation, so in Internet search, I found a little tutorial on the site: How TO - Side Navigation However, in my example I wanted a single button to open and close, so I…
-
1
votes1
answer787
viewsHTML Tags for Razor Engine (Asp.net mvc C#)
I’m having difficulty in my web application with Asp.net mvc, of how to create forms using the Razor Engine. Below follows my HTML code. <form class="o-form" method="post"> <input…
-
1
votes1
answer144
viewsURL by Viewbag
I wanted to run a URL through Viewbag, but I couldn’t. I wanted to do it: ViewBag.Quantidade = "Você Não tem quantidades suficientes, para continuar você deve comprar um Pacote"; ai in case the text…
-
1
votes1
answer61
viewsJoin for 2 tables
How do I use the Join method to give a include of a value from another table? In this case I was going to use the Chamadamusicas table and the Musicavotadas table var chamadaMusicas =…
-
1
votes2
answers8286
viewsNo constructor without parameters has been defined for this object
I am building an ASP.NET MVC5 application using DDD and have separated my Ioc layer from my web application. In my controllers I have constructs with parameter to receive an instance of my service…
-
1
votes2
answers665
viewsBootstrap Collapse
I’m creating a list using the collapse in an interaction of loop, but are all starting open, I would like only the first item of my collapse stay open. If you double-click on one of the items, it…
-
1
votes2
answers554
viewsTaking information from a select and passing an array
I want to take all the fields of one select and store them in a array. I thought I’d do it this way, but it didn’t work. var lista = []; lista = $('#Model').text(); $('#Model').append('<option…
-
1
votes1
answer876
viewsIs it possible to pass the value of a Javascript variable to a C#variable?
The idea is to use javascript to detect the screen resolution, and take the value of the variable of this javascript and pass to the variable of C#. The only thing that’s crossed my mind is creating…
-
1
votes2
answers1110
viewsDisable Dropdownlist in View
Class public class ConfiguracaoEstado { .... [Required(ErrorMessage = "Selecione ao menos um estado.")] [Display(Name = "Estado")] public int EstadoID { get; set; } ... } Controller private void…
-
1
votes1
answer269
viewsGet last login of the user
In my project I came up with this business rule. I need to pick up the last time the user logged in to the system. So it would be something so that I could catch the day and time of the last login.…
-
1
votes1
answer74
viewsDisplay clickable link coming from the database
I want to display the Link that can be clickable, is appearing as text: I’m using the code below, but it still comes as text and I can’t click: @Html.Raw(HttpUtility.HtmlDecode(item.Facebook))…
-
1
votes2
answers56
viewsHow to check input text before post?
Follows the code: @using (Html.BeginForm("Update", "Account", FormMethod.Post, new { @class = "form-horizontal", role = "form", enctype = "multipart/form-data" })) { . . . <input type="text"…
-
1
votes1
answer378
viewsHow to apply Dropdownlistfor with bootstrap?
I have the following code: @Html.DropDownListFor(model => model.CountryId, Model.AvailableCountries, new { @class = "form-control", @readonly = true }) Upshot:…
asp.net-mvc-5asked 7 years, 10 months ago Matheus Miranda 5,375 -
1
votes1
answer69
viewsRestart count when changing year
I have a View that returns data that the taxpayer paid the pension in the current year, where I return the monthly payment of the same. I need to perform the sum of the months, creating a monthly…
-
1
votes2
answers150
viewsWhat is the difference between public async System.Threading.Tasks.Task<Actionresult> Index() and public Actionresult Index()?
Follows the code: Example 1 : public async System.Threading.Tasks.Task<ActionResult> Index() { return View(); } Example 2: public ActionResult Index() { return View(); } Please explain the…
-
1
votes2
answers342
viewsFilter for the next 90 days ASP.NET MVC
need to make a filter with Line in an entity, this filter should bring all events for the next 90 days. Today’s example: 11/01/2017 until 11/04/2017 (90 days) _con.SiteContexto.AsNoTracking()…
-
1
votes1
answer973
viewsPerform field sum in the table
I have a View that returns data that the taxpayer paid the pension in the current year, where I return the monthly payment of the same. I need to sum up the months by creating a monthly subtotal.…
-
1
votes1
answer307
viewsHow to fill a code column for reference with repeated values
I have a query where I have returned several data of each user. However, when performing a search, I have as return the repeated data. I know that this repetition of the data happens because I do…
-
1
votes1
answer112
viewsImage Thumbnail via URL
I want to do so: There is a field where the user inserts the URL of an image, and wanted when pasting this url in the field, a thumbnail appears beside (or below) the field, similar to what FB does,…
-
1
votes2
answers87
viewsSecurity of My Intranet Project
I have a commercial intranet project, but how to validate so that this project is not copied from the root folder, where the IIS runs? Because so if my client has a knowledge he could easily copy my…
-
1
votes1
answer2360
viewsFilter data from a table through a Dropdown
I have a table returning the amounts paid by taxpayers. However I have to return all the data (because the application adds field to field). So far so good. But to show the user, I need to filter…
-
1
votes1
answer227
viewsError when filtering data from Datatable
I own a Viewbag where I populate a select with a list of years. When selecting a specific year, filter the table with data only from those years. To make this filter, I’m using a script:…
-
1
votes1
answer364
viewsAn Object with the same key already exists in the Objectstatemanager. The Objectstatemanager cannot track Multiple Objects with the same key
Guys I’m having a bit of a problem, I’m trying to do an update using the Entity Framework, but when it arrives in Savechanges(), the following error appears. An Object with the same key already…
-
1
votes1
answer708
viewsOne of the fields must be required - Dataannotation
Code example: Model: [Required(ErrorMessage = "Campo CPF ou CNPJ obrigatório")] [Display(Name = "CPF")] public string CPF { get; set; } [Display(Name = "CNPJ")] public string CNPJ { get; set; } User…
asp.net-mvc-5asked 7 years, 7 months ago Matheus Miranda 5,375