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
-
0
votes1
answer147
viewsPass two sets of AJAX values to controller
I need to pass the values of a view model, and of a table, the table is passing normally, when passed alone, the viewmodel does not. Go on like I’m doing: var model1 = objectifyForm(model);…
-
0
votes1
answer112
viewsSearch Object By date and Id Lambda, Linq, Asp.net
I have class called Requisicaodeveiculo, a class called Moving vehicle and class Vehicle. class RequisicaoDeVeiculo { public int Id { get; set; } public DateTime DataDaSolicitacao { get; set; }…
-
0
votes1
answer176
viewsHow to align a button vertically on a Row
I’m not able to vertically align a button inside a Row. I’ve tried to insert a label to force it down, but it doesn’t even move. input[type="text"], select { /*font-size: 13px;*/ } .selectClass {…
-
0
votes1
answer323
viewsHow to load viewmodel fields dynamically into Asp.net core mvc
I have a 1:N relationship between the Person and Contacts classes. In my Edit view, I receive a viewmodel containing a contact list. In my View, I’ve made a single for which you should scroll…
-
0
votes1
answer37
viewsHow do I return a random value from my database already displaying in another tab?
I want to return a random value of the bank and already display in another tab, through a function. For when I click submit already calls this function. Controller public ActionResult…
-
0
votes0
answers275
viewsComposite key mapping Entity framework
Good afternoon, How do I map composite key in my entities, in case 1 entity calls document and its PK is by the property ID and WEBID, and it does FK with the User as I would in that case? Document…
-
0
votes1
answer347
viewsRazor MVC - When using @using (Html.Beginform()) the fields are not in front of each other
I’m starting to study MVC + Razor and in example of basic CRUD, I’m trying to put the fields in two columns, as if I was using in HTML. But my code only works if I withdraw the @using…
-
0
votes0
answers40
viewsPass parameter to new MVC controller
I need to pass parameter "01" of http://localhost:5934/Gestaodeservicos/Catalogo/Cadastro/01, to another controller. namespace Intranet.Presentation.Areas.GestaoDeServicos.Controllers { public class…
-
0
votes1
answer44
viewsMenu call does not enter Action
I have this menu in _Layout.cshtml @if (Response.Cookies["UserSession"]["UserRole"] == "Rh" || Response.Cookies["UserSession"]["UserRole"] == "Admin") { <li> <a href="#"><i class="fa…
-
0
votes1
answer470
viewsHow to count the amount of input elements within a div
Using Asp.net MVC, I am creating one the inputs dynamically using a loop with the di database data. <div class="col-md-12" id="div-contatos"> @if (Model.PessoasContatosViewModel != null) {…
-
0
votes1
answer175
viewsName property does not work using Razor Hiddenfor
I am creating several fields dynamically using Asp.net Razor and for this I am passing the index to a partial view and setting the name property of each field. Everything is working fine with all…
-
0
votes0
answers47
viewsProblems removing items from a List<Viewmodel> when Row is removed using Javascript
I have a contact list that is dynamically loaded using Razor and Javascript to remove lines and reorder field positions. The problem occurs when I click the delete log button and delete all contacts…
-
0
votes1
answer144
viewsVersion of ASP.Net Core
Good afternoon, I’m starting with Dotnet Core, and when I create my first project choosing the option "ASP.NET Core Web App(. NET Core)" in the next screen appears me only the versions below ASP.NET…
-
0
votes1
answer89
viewsHow to send two integer parameters to an Asp.net MVC Controller using Ajax
I have a composite key table (Personal and Professional). The Personal property is in a Hidden and Profioid is accumulated in a data-id. Stays two information must be passed to the controller so I…
-
0
votes1
answer206
viewsUsing Identity with Entity Framework to relate one-to-Many methods to other tables
In my scenario a user has several craft and a vessel has several notes. So I need to relate the user to the vessel so that this user can see these notes. I’m using the MVC 5 project’s default…
-
0
votes0
answers143
viewsSet monetary value field correctly in Asp.Net MVC
I am having problems with monetary value in my Asp.Net MVC application and would like to know how to set up In class [Display(Name = "Valor Produto")] [Required(ErrorMessage = "O campo {0} é…
-
0
votes2
answers305
viewsValidationresult with two parameters
I am trying to use custom validation as explained in this link, but then I can only pass one parameter to validate, and I need both, because if the field is empty and the other is false, it has to…
-
0
votes1
answer55
viewsFunction to include and exclude items according to table
I have this function: foreach (var item in obj.valores) { var ver = db.ProdutosFornecedores.Where(r => r.ProdutoID == item.ProdutoID && r.FornecedorID == item.FornecedorID).Select(r =>…
asp.net-mvcasked 6 years, 1 month ago Mariana 2,512 -
0
votes1
answer268
viewsBinding a checkbox with Viewmodel without the use of Razor (Asp.net core MVC)
I’m having problems with Razor... I need to create a checkbox field and Binding with my viewModel using pure html. Only I’m not being able to do the Binding correctly with the bool property and even…
-
0
votes1
answer252
viewsValidate Datepicker containing date only
I use Asp.Net Core MVC (Razor + Jquery Validate + Unobtrusive). I display in a Datepicker only the date part of a Datetime field through the following code in my Viewmodel: [Required(ErrorMessage =…
asp.net-mvc asp.net-mvc-5 validation jquery.validate unobtrusiveasked 6 years, 1 month ago Braytiner 176 -
0
votes0
answers82
viewsNumerical field error MVC Asp.Net
People I’m having trouble in Asp.NET MVC when I use numerical field I’m having error. Razor is like this @Html.EditorFor(model => model.AliqIpi, new { htmlAttributes = new { @class =…
-
0
votes1
answer112
viewsDo you need to do a controller method to get a model list method?
I have a question if you need and if yes how to create the list method in the controller (I am using MVC) follows the code in the list model: // MÉTODO PARA LISTAR RANKING DE CERTA CATEGORIA public…
-
0
votes0
answers49
viewsLoad one tab into another
I have a layout page where I want to upload information to the notifications button. For this, I made an action in the controller to return a Partialview where a query will be made in the bd looking…
-
0
votes1
answer33
viewsHow to update the Index of a field using Javascript in Asp.net MVC
I’m creating fields dynamically based on a List. When I remove a field, I need to reorder them using javascript, but I am facing problems, because all fields are reordered Indexes, except those that…
javascript asp.net-mvc asp.net asp.net-mvc-5 javascript-eventsasked 6 years, 1 month ago Master JR 1,853 -
0
votes2
answers226
viewsHow to Insert a parameter from my system into an external URL
So, we have a website that when passing a user’s code, it shows the location of the same. Example of the URL:…
-
0
votes1
answer87
viewsI cannot receive the view parameter in the controller
Remembering that when executing it does not return any error Controller using CRUD.Aplicação; using DocumentoObjeto.dominio; using System; using System.Collections.Generic; using System.Linq; using…
-
0
votes1
answer230
viewsHow to implement password encryption?
I want to implement password encryption in user registration. I found here in stackoverflow this post teaching how to use cryptography, but I’m in doubt where to add the code. This method should be…
-
0
votes1
answer303
viewsHow to do a search with Join using Entity framework Lambda and Linq
How do I search two or more tables. In the system I am doing, I have the tables Barco, Tipodeoperacaodobarco and Classebarco My mapping is as follows: HasRequired(c => c.ClasseBarco) .WithMany(c…
-
0
votes1
answer174
viewsIsolate presentation layer domain
Good software architecture practice says that the presentation layer does not You must know the domain layer. I’m trying to make this isolation between these layers, but the that is hindering this…
-
0
votes0
answers61
viewsI can’t draw a Polygon on Google Maps
I’m trying to square it with the coordinates, but it won’t show. There is no error in the browser, the map is created normally, only the square does not appear: var map; function initialize() { var…
-
0
votes1
answer25
viewsGlimpse ASP.Net working with Dapper
I just saw a piece of content where I studied performance and optimization in ASP.Net applications. I was presented with a diagnostic tool called Glimpse. The operation of the tool is perfect, it…
-
0
votes1
answer2001
viewsObject cannot be converted to dbnull in other types
Good afternoon gentlemen. I am making a user registration in the college work and when logging in this error appears. How can I solve? private Usuario Mapear(DataRow registro) { var usuario = new…
c# asp.net-mvc asp.net-mvc-5 asp.net-web-api asp.net-mvc-4asked 6 years, 1 month ago Vinicius Marson 63 -
0
votes0
answers589
viewsPK and FK Conflict in SQL Server Database
I am facing a Primary Key and Foreign Key conflict problem in SQL Server 2017 Express. I am using ASP.NET with Entity Framework Code First (Migrations). The problem is that when I add a new Client…
-
0
votes1
answer25
viewsDropdownlist and Checkbox field triggering a javascript function
I have two Dropdownlist and Checkbox fields that are responsible for entering value into an inputtext How to make javascript code know the status sent true or false from the CHECKBOX to the…
-
0
votes1
answer606
viewsPass id value to from one view to another - Asp.Net MVC
I have the following view where I have a list of articles registered in the database, then I have the evaluate button that redirects to another view where it is in another controller, I want to pass…
-
0
votes0
answers107
viewsImages for the Asp.Net MVC Product
I have a problem, I don’t know how to save more than one image for a product. For example, an X product has a Highlight image (which is the one that will appear in the window), and 4 more images,…
-
0
votes1
answer70
viewsAngularjs: Rendering components causes request loop
I am working on a legacy project, written in Angularjs 1.5.8 and ASP.NET 4.5. In order to upgrade the project Clientside to Angular, the first step I had to take was to compose the system. However,…
-
0
votes3
answers799
viewsAligning Twiter bootstrap buttons inside a Table
My buttons inside the table are breaking the row when a column is added in the table, they are getting like this: My code ta as follows: <div class="row"> <div class="col-md-4"> @using…
-
0
votes1
answer256
viewsLoading from inside partialview js/css
Good morning,insira o código aqui I am unable to load . js/. css when loading the partialview in the layout <!DOCTYPE html> <html> <head> ... @RenderSection("header", required:…
-
0
votes1
answer89
viewsConnect Informix . NET via DSN
Good afternoon, I have been trying for days to connect an application to a Informix database, but I can not at all. I am with Visual Studio 2017 using ASP.NET Framework 4.6. I tried to find…
-
0
votes1
answer551
viewsError trying to save Asp . Net MVC image
Good morning People, I am trying to open, resize and save an image again through an ASP application. But I am getting an error when the image will be saved. Follow the code that is giving error:…
-
0
votes0
answers209
viewsAssembly reference error in Asp.net MVC
I have a DDD project on VS 2017 and Asp.Net MVC, using SDK 2.1.201. I formatted my computer and installed again VS 2017 and SDK 2.1.201... only when I open the project, it gives compilation error in…
-
0
votes0
answers44
viewsUpdate data that has many to many relationship with Entity Framework
I’m trying to update an object and the only thing that doesn’t update is his relationship from many to many the rest as name and surname update [HttpPost] public IActionResult AtualizarProfessor(int…
-
0
votes1
answer34
viewsHow do I relocate the selected item from a Category List to the first position
In my application I have an area with several links of categories that is a Partialview. The categories below comes from the following statement of Categoriascontroller var categorias =…
-
0
votes0
answers105
viewsField ? null is not sending if empty
I have this field: <label asp-for="TransportadorID" class="col-md-3 control-label" style="text-align:left;"></label> <div class="col-md-2"> <input type="text"…
-
0
votes0
answers31
viewsComponent switchery does not work on a Partialview - Asp.Net MVC
I am having problems with data-plugin switchery (Remark bootstrap component) that does not want to work in partialviews. The interesting thing is that if it stays inside a normal view, it works…
-
0
votes1
answer78
viewsNull object with jquery ajax MVC3
I know I must be forgetting something. I am making a request ajax jquery to send a message via contact form, however the object is coming null on controller. I tried doing with the JSON.stringfy and…
-
0
votes1
answer307
viewsCalling a Modal via Html.Actionlink
I have a screen that makes the user password exchange. This screen shows the user name and when clicking on the name, it is directed to the screen to exchange password. As I would make this call…
-
0
votes1
answer93
viewsPass list to model
I have a query that returns me a list this way: var list = db.Comentario.Where(d => d.GrupoTrabalhoId == Id).OrderByDescending(s => s.DataComentario).ToList(); After this query, she will…
-
0
votes2
answers781
viewsLoad select city after selecting state
I have this HTML, and would like when the user selects the state, it loads the city data of the selected state: <label asp-for="Cidade" class="col-md-1 control-label"…