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
-
2
votes2
answers1688
viewsDisplay control in Partial View conditionally
I need a control of a Partial View is displayed according to one condition. For some views a button would appear for others not and this would be set through a parameter in the call of Partial View.…
-
2
votes1
answer149
viewsHow to customize "Confirmation window"?
Follows the code: @using (Ajax.BeginForm("Action", "Controller", new AjaxOptions { HttpMethod = "POST", OnSuccess = "OnSuccess", Confirm= "Tem certeza ?" }, new { @class = "form-horizontal", role =…
-
2
votes0
answers53
viewsMVC5 - What is the correct way to work with MVC in the case of data return from a grid?
I have a model with 4 fields that after a filter displays a grid with X records on the same page (VIEW). I would like to know the best way to return the "grid" data in question to the controller?…
asp.net-mvc-5asked 7 years, 7 months ago rijovanni 21 -
2
votes1
answer1309
viewsAdd values from object list columns in Razor
I have a table, where I receive data from a View (SQL Server) and perform some operations on my page. On this page, I have a filter to show only the pages referring to the selected year. Even this…
-
2
votes1
answer39
viewsHow to call another action and return the value?
Follows code: public ActionResult Teste1(int num1, int num2) { var valor = Teste2(1, 2); //Aqui recebe valor nulo } public ActionResult Teste2(int num11, int num22) { //Alguns valores aqui... var…
-
2
votes1
answer142
viewsNon-configuration element not declared
In the Web.config, the problem occurs on the line: <configuration> Error list: Elemento 'configuration' não foi declarado. Some solution ?…
asp.net-mvc-5asked 7 years, 6 months ago Matheus Miranda 5,375 -
2
votes1
answer734
viewsMVC - Creating a typed model as a generic list
I would like to create a typed model being a list of the type T. Utilizing: Razor from ASP.NET MVC 5 For example: My model in the cshtml will look like this: @model List<T> @foreach (var item…
-
2
votes1
answer90
viewsSearch all table fields in an Action
I would like to know how best to prepare a query that searches in all fields of a table. Let’s say I own a news site, and on this site I have a input for Search in my template. When entering the…
-
2
votes0
answers1115
viewsAsp.Net MVC 5 vs Asp.Net MVC Core?
I see many talking about Asp.net Core. Is it worth migrating MVC5 to Core ? Or should I continue with MVC5?
-
2
votes0
answers70
viewsMvcsitemapprovider with ajax
So, I’m trying to assemble a menu through ajax requests using also Mvcsitemapprovider, but when I try to access mine CurrentNode in my ajax request, is giving as null My request ajax $.ajax({ url:…
-
2
votes3
answers757
viewsError while updating data
I have a base repository where I only perform CRUD. When working with one data at a time, it works normally. However, I needed to make a modification and send several records to be edited at once.…
-
2
votes1
answer64
viewsSave data by disregarding hidden DIV’s
In my View i own a select that hides and shows thediv in accordance with the select chosen. This part, is working correctly. This select has three options, and the form changes according to the…
asp.net-mvc-5asked 9 years, 6 months ago Randrade 21,612 -
2
votes1
answer1172
viewsConfigure routes using areas in ASP.NET MVC 5
I am trying to set a route using area as follows: At Routeconfig.Cs public class RouteConfig { public static void RegisterRoutes(RouteCollection routes) {…
-
2
votes1
answer460
viewsCan the Crosscutting layer recognize my Dominion layer?
My doubt is very simple. Can my Crosscutting layer know my Domain layer? since the Repositorio(Data) layer knows it both being inside the Infra Layer. Excuse the question, because I’m still new to…
-
2
votes1
answer92
viewsHow to bar the registration of an already registered user
I am developing an application that manages Courses in Asp.net MVC, I’m still a beginner, and I’m trying to do the following: The Student has a screen where he lists all the courses for him to…
-
2
votes1
answer338
viewsGet URL value from a Dropdownlist
In my application I own a DropDownList that filters the search data. When filtering, it retrieves the value of the QueryString and save the value in the DropDownList (so that when changing page, the…
-
2
votes2
answers1783
viewsX.PagedList.Mvc with Core and Bootstrap 4.0
How to use the X.PagedList.Mvc with Core and Bootstrap 4.0, and thus create a full automatic pagination.
-
2
votes1
answer54
viewsMiniprofiler V4 does not render on MVC5 + EF
Good morning, you guys. I installed the MiniProfiler v4 in my project ASP.NET MVC5 to check some slow points, however, the results screen is not rendered in my view - and no error appears in the…
-
2
votes1
answer404
viewsProblem with Entity Framework Relationship
I am having problems in the relationship of my bank, I am developing an application that manages Courses, I am still beginner in Asp.net MVC. I have two tables Pupil and Course, and I have another…
-
2
votes1
answer659
viewsCause form validation on an Asp.net link mvc 5
Good afternoon, everyone! I have a form, I created the rules using Datanotations and it works great when I use a button or input type Submit within my form. Validates very well! I want to exchange…
asp.net asp.net-mvc-5 jquery-validate model-validation unobtrusiveasked 9 years, 5 months ago Fabio Luis Rodrigues 31 -
2
votes1
answer167
viewsSignalr loses connection when giving a Postback
The idea is to keep the user logged in to Chat as he navigates the pages. Layout of the components on the page Layout.cshtml function iniciarChat() { var chatHub = $.connection.chat;…
-
2
votes1
answer272
viewsOn which layer should I create constants in my application with DDD concept?
I’m using the DDD concept (Layers: Presentation, Application, Domain, Data and Crosscutting) in my ASP.NET Core MVC application and I was wondering about the best place to create my constants. In my…
-
2
votes0
answers361
viewsDoubt about using Identity in layers
I created an Aspnet MVC project with Identity to understand how the Identity part works. I made changes to the code, including roles and Claims. I switched this project to a company project, but the…
-
2
votes1
answer836
viewsHow to use JSON on Asp.net MVC
I’m a beginner in Asp.Net MVC, and I’m developing an application that manages Courses and on my screen of enrollment I’m trying to do a validation that case the pupil is already registered in a…
-
2
votes2
answers511
viewsValidation via Javascript
In my application that manages Courses, I need a validation via javascript. I have a screen where the pupil makes his registration in a certain course, what I wanted is that when he click the button…
-
2
votes1
answer957
viewsForm using Begincollectionitem gets null viewModel in foreach
I want to make a form where I can register several addresses and phones to a single person, and I want to be able to do this when I’m registering the person. Based on the answers to my other…
-
2
votes1
answer194
viewsHow to pass Object type parameter to Jsonresult
The view always receives the Null object, why ? This is the jquery code snippet: var obj = new Object(); obj.TBCOMPOSICAOID = 0; obj.DSCOMPOSICAO = "TESTE"; var TBComposicao = JSON.stringify(obj);…
-
2
votes1
answer466
viewsAsp.Net MVC does not run Jquery after calling Action through "url:"
I need to call an Action using Ajax and until then everything right, I make the request as follows: confirm: function () { $.ajax({ url: urlToDelete + id, success: function () { //window.location =…
-
2
votes2
answers516
viewsDatatable column filter Asp net mvc5
I have a problem using the plugin datatables column filter, it does not report me error but also does not generate filters, follow my code: <script language="JavaScript">…
asp.net-mvc-5asked 9 years, 3 months ago Jeff Silva 48 -
2
votes1
answer97
viewsHow do I not lose the data included in Claims in the revalidations of Cookies?
I have an application that needs to control the access of users who are according to the profile of each one. Empresa, Filial. In the User entity I added the fields referring to these other two…
-
2
votes1
answer1235
viewshow to select Count using Linq C#
I need to convert this chunk of SQL code to Linq C#. I’ve been able to convert virtually every code. SELECT COUNT(Q.ID_QUALIFICACAO) AS CONHEC_ESPECIFICO FROM QUALIFICACAO Q INNER JOIN ATENDIMENTO A…
-
2
votes1
answer965
viewsHow to upload a file at the same time as sending an Asp.net mvc 5 form
I already have a form that makes a registration, I want to add an extra field in it where the user will upload a photo, I want to do everything in the same Ubmit. My VM Vmdominiocreate: public class…
-
2
votes1
answer220
viewsImage stored in the bank is not displayed in the View
I’m trying to display an image that’s stored in the database. When the Photo (Image) field of the table is null, I display a default image that is stored in the directory. The problem is that the…
-
2
votes1
answer1247
viewsHow to take the Dropdownlist ID and move to a jQuery variable?
I have the following Dropdownlist: <div class="editor-field"> @Html.DropDownList("ProdutoId", String.Empty) </div> And this jQuery function that when the user presses the button will…
-
2
votes1
answer895
viewsView passing date to Model in wrong format
I’m using Bootstrap-Datapicker as date field in my form and globalizing with moment-with-locales. The configuration I used is as follows:: $('.datetimepicker').datetimepicker({ locale: 'pt-br',…
-
2
votes1
answer59
viewsSearch form does not execute controller method
I have the following form: <form role="search" method="get" id="search-form" name="search-form" action="/video/pesquisa"> <div class="cover-pursuit-btn"> <button type="submit"…
-
2
votes1
answer87
viewsConvert SQL script to Linq
I need to convert the SQL script below to Linq. SELECT [ID_Pessoa], [ID_ArquivoPagamento], SUM([Peculio_Valor]) AS 'Peculio_Valor' FROM [VW_PESSOA] WHERE [ID_Pessoa] = @ID_Pessoa AND…
-
2
votes1
answer1537
viewsDoubt with passing Parameter Asp.net MVC
Calling the controller is no longer calling the Actionresult (Solved) I have my view: @model IEnumerable<Generico.Dominio.TB_MENU> @{ ViewBag.Title = "Index"; } @Html.Partial("_navbarInterno")…
-
2
votes1
answer129
viewsDropdownlistfor in a for
I am trying to fill in with the selected value one DropDownList within a for, but it’s not working properly. What happens is that when the Action Index returns the model to a View, values are not…
-
2
votes1
answer603
viewsMessage de Aguarde when clicking the save button
Hello, gentlemen I’m having trouble putting a message waiting for the user when they click save button and stay waiting for the return of the server. I am using Jquery Dialog and Partial View to…
-
2
votes2
answers308
viewsHow to Include an Item in a Icollection
I have a class Person who has a ICollection telephone class. On the Person maintenance screen I have a datatable with the Phones. There is a link to add a new phone, but I can’t use the…
-
2
votes1
answer380
viewsRoutine included in Threadpool to run in "background" does not let the application continue running
I have the following code snippet in a method from my ASP.NET MVC application that deals with deleting directories and their files. // efetuo processos de remoção de arquivos do banco de dados await…
-
2
votes1
answer65
viewsEntity Framework - Relationship Association Problem 1 to 0.. 1
I have a problem of association between two tables. Student and Student Tables. Public class Aluno { [Key] public int cod_aluno { get; set; } ........ public virtual Aluno_Unidade_Curso…
asp.net-mvc asp.net-mvc-5 entity-framework entity-framework-6asked 8 years, 7 months ago Rodolfo Araujo 23 -
2
votes1
answer1063
viewsASP.NET MVC Calculate value in a table
I’m developing a record where I’ll have a table with some additional details that should be entered together with the main register. But one of the columns of this table is calculated, which is…
javascript jquery asp.net-mvc asp.net-mvc-5asked 8 years, 6 months ago Pablo Tondolo de Vargas 5,444 -
2
votes1
answer130
viewsProblem with Bundle on the server
Good morning, I was implementing the use of Bundle in my ASP.NET MVC project, in the development environment worked perfectly. But when I go up on the server it does not work. I went to debug in the…
-
2
votes1
answer393
viewsMOIP consumes Json Web Api MVC
I need to use the Moip Payments API as a payment method for my system, how do I request via json? Documentation Consultar cliente GET Por meio desta API é possível consultar as informações e…
-
2
votes1
answer867
viewsUpdate multiple databases using code first without using console
Good afternoon, you guys. I have an application that each client has their database and I am using the code first. To update I am always running in hand the command update-database -force in the…
-
2
votes0
answers243
viewsBeginform makes GET instead of POST
I have a controller that has two actions; public ActionResult Cadastrar() { return View(); } //[ValidateAntiForgeryToken] [HttpPost] public ActionResult Cadastrar(Usuario usuario) { if…
-
2
votes1
answer468
viewsHow to position a Span tag on the page?
I’m studying ASP.NET MVC 5 and I’m trying to create a page where, in the upper left corner, I would have a "Menu" button, I was able to create the button and action, but I’m having trouble locating…
-
2
votes2
answers1172
viewsHow to make a button with Razor and Css
I’m trying to make a button on a particular page. However, my entire project started with the Razor engine, so I would like to know how I can make a button with such engine, I am trying to do so:…