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
answer54
viewsCustomize ASP.NET Identity
I still only use the FormsAuthentication but I’m looking to migrate to the ASP.NET Identity in MVC. In my current projects, I don’t work with roles of FormsAuthentication, and yes by permission of…
-
0
votes1
answer61
viewsI would like to understand why when Modelstate is invalid, Viewmodel instantiation is "ignored" and form fields remain populated?
Follows my code: Subcategory Model public class SubCategoria { public int Id { get; set; } [Required(ErrorMessage = "Campo {0} é obrigatório")] [StringLength(200, ErrorMessage = "Campo {0} precisa…
-
0
votes1
answer66
viewsView does not render after Return - Asp.net MVC
Good afternoon, you guys! Following scenario: I have a search button in my Layout that uses the text field and select to send data to javascript, which calls an action, which calls the repository…
-
0
votes0
answers142
viewsHow to return to previous View without losing data
I have a problem that I can’t solve, which is this. I have a screen that loads two simulated (each simulated has the questions and the radios Buttons that are the options). The simulated ones are…
-
0
votes1
answer124
viewsDoubt with json format Asp.net core web api
Hello I have a functional example of data query searching the zip, the data are returning in the format: function searchCep () { // Recupera o value do input cep let cep =…
-
0
votes0
answers26
viewsFill screen with data from an auxiliary table
I created a Service Order registration, the insertion is working perfectly, I’m trying to create the change page, this screen brings all the data, I just can’t list the items in the table. Follows…
-
0
votes1
answer92
viewsViewbag Life Cycle in C# MVC
I know the life cycle of ViewBag of C# MVC, is by request. Doubt If I set one ViewBag with the same name in several controllers, there is the possibility of the set information being read /…
-
0
votes1
answer941
viewsError running ASP.NET Core application
I am starting the journey to learn ASP.NET Core and when I try to run the application I have the following error: An unhandled Exception occurred while Processing the request. Socketexception: No…
-
0
votes1
answer43
viewsJS or Jquery pass two array’s, input text and input check when checked
I need to pick up the text field when the input check is checked. I can already pick up my controller. But the text field is not. They are generated by the database and therefore need to be treated…
-
0
votes1
answer113
viewsMVC DDD Project
I’m creating an application, using the DDD standard, so in my Presentation layer, I create viewModel, and in the controller I use the Mapper.Map<Entidade, EntidadeViewModel> . i would like to…
-
0
votes1
answer24
viewsMapper.Map Addressmodel.Citysmodel Endereco.City
I have the class Addressee public class Endereco { public virtual Cidade Cidade { get; set; } public int CidadeId { get; set; } } And I got the Viewmodel Of That Class: public class…
-
0
votes1
answer38
viewsPlacing disc or Circle or square markers does not work
I did that <tr class="espaco-branco table-prod-add"> <ul type="disc"> <li> <td style="white-space: nowrap;"> @mainItem.ShoppingCartMessage </td> </li> </ul>…
-
0
votes2
answers66
viewsPrevent user to change field before completing
In some specific forms, I want to validate if user has completed the field in full. Should he come out of input, an alert on the screen is displayed, and then the focus goes back to that field. I…
-
0
votes3
answers1009
viewsHow to make a Useful days rule in Asp.net and C#?
good afternoon I am wanting to create a billing email sending rule that when there is a holiday he considers the next day and if it is Sunday he performs the task on Tuesday. Today the system uses a…
-
0
votes2
answers99
viewsSending a Data List by Email - ASP.NET MVC C#
Good evening, I’m making a web application for college where I need to send a list of data (food) coming from a quote. That is, the user selects the items that will quote and after this sends via…
-
0
votes0
answers30
viewsWhy does the Identity mvc template ultilize async in controllers?
When creating a template ASP NET MVC 5 with Identity for example the Login method uses async not to lock the main thread. I did not understand what is the need to do this being that after the user…
-
0
votes1
answer80
viewsHow to set variables with JSON received from an AJAX request
I am receiving a JSON and would like to set variables with such information. How do I do this? $.ajax({ url: "/pessoa-gerenciar/consultar-codigo-postal", type: "GET", data: { codigoPostal:…
-
0
votes0
answers162
viewsThe INSERT statement conflicted with the FOREIGN KEY constraint "Fk_dbo.Counter_dbo.Addresse_addressacoid"
I have two problems. I have the entity Accountant, Address and City. Every time I register a new one accountant, I have a dropdowlist who carries the cities so I can choose, the problem is that…
-
0
votes0
answers37
viewsMerge 2 PDF into 1 Asp.net MVC
I have 2 pdfs files and want to join the 2 in one file only, my method is as follows: public async Task<FileResult> Teste(int id) { var objRelatorioTecnicoData =…
asp.net-mvcasked 5 years, 4 months ago Stand Alone 350 -
0
votes1
answer189
viewsHow to change the Text and icon of a label using JS or Jquery - Asp.Net MVC
I need to set the description (EnderecoTipoDescricao) and the icon (icon fa-home) at the event change of a SELECT. For each Row the "Addressdescription" field has an id whose index is incremented:…
-
0
votes0
answers248
viewsUnity - No public constructor is available for type Mvcteste.Repository.Iempresaservice
I’m using UNITY to inject dependency. net framework 4.5, configured everything else at the time of running is presents the error : No public constructor is available for type…
-
0
votes1
answer110
viewsGenerate Unico Code in Sequence without Repeating MVC
I want to generate a registration code for each registered client. As ID I use the GUID, however, it is for ID(as it is extensive), I need a small code, not just a digit, for example: cód: 0001 , It…
-
0
votes1
answer56
viewsRelationship 1:N in the Entity Framework
Good afternoon. I am studying the Entityframework and I am not managing to do something that seems to be simple but will not. ( I wanted to make a 1:N relationship between a table for a customer…
-
0
votes0
answers38
viewsHow to pass Image by Image to add to the database?
I’m trying to add image to the database, how do I temporarily add object by object up, varying the object according to which index you upload? as I tried to do on line 7 I know there are…
-
0
votes1
answer49
viewsHow to upload images(several) to the Asp.net database
I have a code in asp.net which aims to upload an image to the database, and I need to adapt it in order to move several up, only I have no idea how to do that. Follows the present code: Model public…
-
0
votes3
answers103
viewsSend error for duplicate login C#
I’m implementing a login system, but I can’t send an error message to when I try to create a duplicate login. I declared the login as follows: [Index("User_UserName_Index", IsUnique = true)] public…
-
0
votes1
answer189
viewsError "Settings to access '"' printer are not valid."
I have an application ASP.Net MVC that makes product sale and printing of this sale we work with several brands of thermal printers (not fiscal) as: Tanca, Bematech, Epson, among others.. we use to…
-
0
votes1
answer426
viewsThere is no Viewdata item of type 'Ienumerable<Selectlistitem>' that has the key 'Usuario.T003_FK_COORDENACAO'
I’m having a problem with Dropdownlistfor, it’s populated with database data. Controller Code. var coordenacaoList = db.VW004_LISTAR_COORDENACAO.ToList(); ViewBag.CoordenacaoList = new…
-
0
votes1
answer378
viewsHow to pass javascript values to C#
I have a Client class, where a customer can have several benefits as you can see in the last property. public class Cliente { /// <summary> /// Id /// </summary> public long Id { get;…
-
0
votes1
answer43
viewsHow to replace with null or blank values
Problem: When the customer clicks to send the request the system takes the product selected and the dimensions of that product. Only not all products have box or is any other feature of the same.…
-
0
votes0
answers35
viewsTable stylization problem using Bootgrid()
When I rethink that table within a Modal and use the function BootGrid(), it cannot load all the necessary styles, making the navigation buttons for example not properly stylized. Code of the table…
-
0
votes1
answer439
viewsPassing view data to controller with Viewbag/ how to pass jquery script value to viewbag
I have the following excerpt <div class="form-group"> <div class="col-lg-6" style="margin-left:15px"> <div class="row"> <div id="Empreendimento" class="form-control">…
-
0
votes0
answers27
viewsHow to structure the partialView To make the modelBinder correctly?
I have a form that was broken using partial view, there is only one Create for all of them, and then I think there is nothing wrong, when trying to submit the form I got the following error..... `…
-
0
votes1
answer23
viewsAreas - How to make a directory appear before Controller/Action/ on the route?
Hello. I created a web project ASP.NET MVC Core in the Visual Studio 2019 and I created an area called Managerial. Inside it, in the Views folder I created a subfolder called Products and put some…
-
0
votes0
answers42
viewsError clicking Header to order Datatable.js
I’m using the api Datatable.js and I’m going through the following problem: When I click on any coluna da table html to make the ordenação the entire content of the tag tbody remain only one line…
-
0
votes1
answer123
viewsMascara Doesn’t Work
my mask doesn’t work when I wear a variable. for example: Projeto.Aplicacao.ViewModel.Clientes.ClienteViewModel cliente = (Projeto.Aplicacao.ViewModel.Clientes.ClienteViewModel)(ViewBag.Clientes);…
-
0
votes0
answers47
viewsRemove(item) Not working Asp.Net Mvc
I have a method that uses remove to remove from the list. but not for sure, not from the error, and neither does it remove. first I go on the bench to get the object. var ctrl =…
-
0
votes1
answer187
viewsException released when deleting registry using Entity Framework Core. How to resolve?
When trying to delete registration of entities "Patients" and "Doctors" is returned an exception. The strange thing is that for the entity of "Schedules" everything happens normally. Follows the…
c# asp.net-mvc entity-framework entity-framework-core asp-net-coreasked 5 years, 2 months ago Ramon Almeida 382 -
0
votes1
answer81
viewsViewmodel is NULL when performed a Submit in the Main View - Asp.Net Core MVC
I have a Viewmodel (FilialViewModel) who owns a property of the type PessoaViewModel. The main view is linked to the Filialviewmodel and whenever I make a Submit, the property of the Personal type…
-
0
votes0
answers62
viewsModelstate invalida
I have a class called, Colaborador. and the collaborator has a bank. public class Colaborador { public virtual Banco Banco { get; set; } public Guid? BancoId { get; set; } } my problem, is that even…
-
0
votes1
answer1235
viewsInput Mask Razor
I’m in need of help to include a CPF and CNPJ mask with Jquery or Js, so that it changes automatically after I click on a select, but I’m not able to include the mask inside the Razor I made.…
-
0
votes0
answers32
viewsEncrypt data between Controller Asp.Net Mvc and Jquery Ajax
I communicate between Back and Front End with Ajax, but I don’t know how to encrypt the data transported, this is a method of my controller that returns a Json I call through the Ajax: [HttpGet]…
-
0
votes0
answers86
viewsHow to get back Task<int> of a function (Mediatr) - Asp.net Core MVC
How do I get the entire value returned through a Task? I have tried several ways, as I have seen in forums on the net, but I could not. I tried to use var customerId =…
-
0
votes2
answers607
viewsError add-Migration . net core 3
I am trying to add the add-Migration in my solution but always happens the following error "Value cannot be null (Parameter 'connectionString')" but my connection string is correct in…
asp.net-mvc postgresql asp.net-core asp.net-web-api asp.net-core-web-apiasked 5 years, 1 month ago Diego Wenndson Souza 3 -
0
votes2
answers53
viewsDoubt to Bring a Details of Two Tables MVC5 Entityframework 6.2
I’m studying ASP.NET MVC5 for college, and I came across a problem, I have three tables: Usuario, PessoaFisica, Endereco. My problem is this, when I’m right in the system, I can only bring the…
-
0
votes1
answer33
viewsSend hyperlink by email - link break
I’m trying to send one hiperlink by email, however it breaks at the time of space, in the same email, I send two hiperlink, one that has no space at all, it sends correctly, but this one it breaks:…
-
0
votes1
answer190
viewsShow/ Hide table row
I create a table dynamically and that lists Nodes (with 'FATHER' and 'Sons'), I would like that when loading only the first nodes (FATHER) appear and when clicking the children were shown. The click…
-
0
votes1
answer897
views"The HTTP request was Forbidden with client Authentication Scheme 'Anonymous'"
I am trying to communicate my application with the Cadsus web service from an Asp . net core application. I have using the code below, but whenever I try to recover the return of the query I get the…
-
0
votes1
answer1174
viewsHow to pass Json parameters, to consume a C#API
I am trying to consume a Pay API transfer that asks to be passed the email of who will receive, the value and the description, I did according to the model below but I think it is not correct. Note:…
-
0
votes1
answer129
viewsInstantiate list and Insert values at different times
Hello, in a web application, I need to insert values in a list at different times. This insertion occurs after the user fills in fields on the page and gives the Submit in the form. In Submit is…