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
-
2
votes1
answer341
viewsHow to call a database Function from the code
would like a help, i have the following Function that is in the bank postgres CREATE OR REPLACE FUNCTION public.get_id(campo character varying) RETURNS integer AS $BODY$ DECLARE _id integer; BEGIN…
-
2
votes2
answers2464
viewsASP . NET MVC and Javascript - Open modal with ID of the selected object in a list
INITIAL QUESTION I am working on an ASP . NET MVC project with bootstrap and need to open a modal for editing and deleting records from a list. The idea is not to leave the buttons next to each row…
-
2
votes1
answer31
viewsSettings Many to Many code fast Migration
good afternoon! I have this many configuration for many in my project. public class Usuario { public Usuario() { this.LocalTrabalho = new HashSet<LocalAtendimento>(); } public virtual…
-
2
votes2
answers111
viewsTextboxfor with white spaces
I have a Textboxfor that lists the record of a table field. When displaying in the view, the textbox throws blank spaces after displaying the record content. I realized that these spaces are to…
-
2
votes1
answer624
viewsButton on a View with MVC/Web API
When we put a button in a View, how do we fire a click of it? I have this button: @model IEnumerable<CarregaDados.Models.Cliente> @{ ViewBag.Title = "Index"; } <h2>Index</h2>…
-
2
votes2
answers812
viewsbut this Dictionary requires a model item of type 'System.Collections.Generic.Ienumerable`1[Webapplication4.Models.modelExemplo]
I can not carry out enumerate, I switched to another reception of information in the View but I do not know how to correct, I checked other forms in Stackoverflow but I did not understand. Model:…
-
2
votes1
answer680
viewsShow specific error in ASP.NET MVC
I created a site that works normally, however, when uploading it to the hosting server, it shows an error: Server Error in Application '/'. Since the error is too generic, he says to include the…
-
2
votes1
answer260
viewsRoutine to download and unzip zip file on the server itself
I need to develop on my website (ASP.NET MVC) a routine that downloads from another server a zip file made available weekly and unzip in my own hosting service. This routine can be triggered by a…
-
2
votes0
answers46
viewsError reading HTM file for HTML conversion to JSON file
In this Topic I created Been asked how to download zip file from Box server and unzip it on my hosting service which occurs perfectly. After the previous events described, I want to read the html,…
-
2
votes1
answer299
viewsError: Multiple controller types Were found that match the URL
When requesting a service by my App, gives me this error: Multiple controller types Were found that match the URL. This can if happen attribute Routes on Multiple controllers match the requested…
-
2
votes1
answer160
viewsDoubts about routes Angular JS x ASP.NET MVC
I would like to clear up some doubts about Angular JS x ASP.NET MVC. Created an empty ASP.NET MVC application that will work with WEB API, configured all my routes with Angularjs, created an html…
javascript asp.net-mvc angularjs asp.net laravel-routesasked 6 years, 12 months ago Nicola Bogar 1,149 -
2
votes1
answer637
viewsHow to Change Default Validation Message Language of an ASP Application. NET MVC
I have a model like this: [Display(Name = "Protocolos Abertos")] public int ProtocolosId { get; set; } I use in a Selectlist like value, when I am going to do the Submit of a form the validation…
asp.net-mvc web-application web.config internationalizationasked 6 years, 11 months ago LP. Gonçalves 883 -
2
votes1
answer158
viewsAdd photos and gallery to an ASP MVC product
I’m starting in Asp.net using mvc 5, I’ve taken some basic courses, and now I want to make a simple little complex virtual store. but I am in a crucial doubt in the product table, it will have a…
-
2
votes1
answer1353
viewsC# Decimal field accept value equal to or greater than 0 in validation
I’m having trouble validating my type fields decimal using Razor, when I try to enter 0 in the field it gives the following error message. The field XXXX must be a number. Follow down my class and…
-
2
votes1
answer146
viewsUse variable value not yet declared. Circular Reference in c#
I know the question seems absurd but a client of mine gave me an excel spreadsheet that has a variable that is used before having its calculation defined. In excel this calls Circular Reference. I…
-
2
votes1
answer1186
viewsMultiple select list with items already selected using Razor
I’m using Razor to generate a SelectList thus: @Html.DropDownList("StatusImovel", new SelectList(ViewBag.ListaStatus, "IdStatus", "Descricao"), new { @hidden = "hidden", @multiple = "multiple",…
-
2
votes1
answer38
viewsError When Customizing MVC5 Routes
Error occurs in method (Registerroutes) in Routeconfig.Cs on line routes.MapMvcAttributeRoutes(); When running in the browser: * The built-in Constraint resolver of type…
-
2
votes2
answers77
viewsSelectlistitem with custom attributes
I created a DropDownList by the method below: private void PopulateDropDown() { //Chamo o método que obtém a lista de clientes da API List<Models.Cliente> clientes = new…
-
2
votes2
answers3799
viewsLoad a Dropdownlist based on an Enum - Asp.net core
I have a Personal E-nature that relates to the Person table. I need to create a dropdownlist in my view that displays the list of Personsnaturezas (PESSOA FÍSICA E PESSOA JURÍDICA), including…
-
2
votes1
answer1598
viewsRemote server returned an error: (400) Incorrect Request
I created two methods, one for authentication via A1 and A3 type certificate and one for sending an xml, both of which request a client’s Rest api. In the authentication method, I send my…
-
2
votes1
answer501
viewsEntityframework + Sql Server + ASP.NET MVC
Hello, I have an ASP.NET MVC application that is using the ORM Entityframework to communicate with an SQL Server database! I currently switched computers and had to install everything again, Visual…
-
2
votes1
answer77
viewsIs it possible to insert parameters in Filters Attributes?
I use ASP.NET and to do the access control by level, I use a filter that checks the level of permission of the user and allows access to view. [HttpPost] [AutorizacaoFilterAttribute] //Esse filtro…
-
2
votes2
answers73
viewsMVC Encrypt/ hide information according to User function
Can anyone help encrypt information according to the user’s role? Basically I want the following: if the user function is = "Admin" the phone number appears 435267456. If the User function is =…
asp.net-mvcasked 6 years, 6 months ago John 189 -
2
votes1
answer1545
viewsPosition focus in a field of a modal window - Javascript and Asp.net MVC
I have a view model that has a block that opens modal windows for CRUD actions. I have 4 partial viewls: create, delete, Details and Edit ... All have the Description (Description) field in common.…
-
2
votes2
answers1139
viewsGet Solution Folder C#
I have a solution with 4 projects inside. In my controller I need to open an HTML that is inside another project, but I can’t open the file folder. Below follows print with my structure: The class…
-
2
votes1
answer466
viewsValidate empty fields in XLSX file - (Epplus) ASP.NET
I am importing an XLSX file into C#, using Excelpackage. I do some validations on import Ex: Numeric, text and if field is empty. Note: If all columns in my file are filled in the import is done…
-
2
votes1
answer1913
viewsThe name 'Component' does not exist in the current context
I’m trying to create a Component view to reuse on the pages, I’m trying to follow some video tutorials. I’ve installed via nuget the entire Microsoft.AspNetCore.Mvc, but when I try to call it from…
-
2
votes1
answer74
viewsTaking value from mvc array
I’m passing an angular array through JSON this way: $scope.gravaItem = function () { $.ajax({ type: 'GET', url: '/TaxaPreco/SalvarItens', dataType: 'json', contentType: "application/json;…
asp.net-mvcasked 6 years, 5 months ago Mariana 2,512 -
2
votes1
answer197
viewsPOST model reaching null in controller
I’m having a complicated problem with my code that I can’t seem to solve. Initially, I have a function SubmitUsuarioRegistro of Javascript that carries out the post of the user’s profile, forwarding…
-
2
votes1
answer161
viewsDownload Bank Image with ASP.NET MVC5
I am saving images in the database in varbinary format. byte[] arrayImagem = null; using (MemoryStream memoryStream = new MemoryStream()) { novaSolicitacao.Anexos.InputStream.CopyTo(memoryStream);…
-
2
votes2
answers1868
viewsGrab URL and skip to the next page
I have tried several ways, I need to take the value of the current URL, and move to the next page, so that after the action of the create is completed, I go back to the URL that was passed, how can…
-
2
votes1
answer245
viewsUpdate modal when deleting record from table - MVC
I have this modal, and I have the function to exclude, I need the data to be deleted and updated, without closing the modal. Follow the code as follows: This is the modal: <div class="modal fade"…
-
2
votes2
answers202
viewsModel error on Razor page
I have this cshtml @model IEnumerable<TreinamentoCrud.Models.Cidade> @{ ViewBag.Title = "Index"; } <h2>Index</h2> <p> @Html.ActionLink("Create New", "Create") </p>…
-
2
votes1
answer107
viewsI’m not getting a list of an API
This URL works on Postman: http://localhost:56137/api/Getcidade. I need now in another MVC project to bring the list of cities. When I do this I catch this mistake: The template item inserted in the…
-
2
votes0
answers487
viewsRender Image with Rotary Pdf (Asp.net Mvc)
I have an Action responsible for generating the pdf using Rotary... The action code is as follows:: public ActionResult PDFPadrao() { string header = Server.MapPath("~/Views/Relatorio/Header.html");…
-
2
votes2
answers684
viewsPass JSON.stringify to Controller
I am trying to pass a table via JSON.stringify, in ajax, is receiving the data perfectly, but I cannot pass to the controller. I’m passing that way: function enviarDados(produtos) { $.ajax({ method:…
-
2
votes1
answer40
viewsDoubt generating entity from Cs file code in edmx C#
In the version of ".Net Framework 4" I have a project that when using . edmx did the automatic generation of Edmschema where in my project I did so: 1 - ADO - (Project Class Library) 2 - Archive .…
-
2
votes1
answer58
viewsHow to create an index for viewmodel fields to be added dynamically
I am creating some fields dynamically in Asp.net core mvc to register a contact. For this, I use a partialview. Inside a div I’m adding each Row of Fields, as the user clicks on the Add New Contact…
-
2
votes3
answers257
viewsSecurity Exception on UOL Host
I developed an ASP.NET MVC application that runs perfectly on site. When climbing it to UOL Host, when accessing the page (www.manuelaibi.com.br) I have the error Security Exception... It is…
-
2
votes1
answer437
viewsPass controller error to view
I am making a basic login form and I find myself in the following situation: I want to return an error if the user does not exist in the database and am doing so using "Modelstate.Addmodelerror".…
-
2
votes0
answers74
viewsModel not being fully validated
Good morning Guys, I’m testing an application to add a client, but whenever I try to add the user, test the Viewmodel to see if the information is consistent, but the program does not validate all…
-
2
votes1
answer52
viewsHow do I pass the value of the Tumb variable to my controller?
How do I pass the value of the Thumb variable to my controller? The two input fields then pass normally, but the Tumb variable has to pass the video Image Url. Controller [HttpPost]…
-
2
votes2
answers86
viewsLimit index query but not combo query
Good afternoon, In the company’s ERP we have a query in the Index that is limited to 80 records. The problem is that in create we have combos that bring more than 150 records and is also limiting to…
-
2
votes1
answer279
viewsHow to change the color of a div via javascript with one condition
I’m trying to change the color of a div if the following condition is true, if( @ViewBag == "reservado" ), but I’m not succeeding, could someone tell me how the code would look with this condition…
-
2
votes1
answer378
viewsHow to redirect user to a specific page after login
I am able to login by type of user: administrator or common. And I am using: [Authorize(Roles = "Administrator")] and [Authorize(Roles = "Common")] Inside the controllers I want to restrict by type…
c# asp.net-mvc login authentication forms-authenticationasked 6 years, 1 month ago Rodrigo Santos 159 -
2
votes1
answer839
viewsHow to call a modal in the View from the Controller Actionresult
To call a modal from the Controller’s Actionresult, after the user clicks the button to register? The controller is currently redirecting to the index page after the user registers. I want instead…
-
2
votes1
answer282
viewsUpload Image, and Create a Thumb of the same Asp.Net Mvc Image?
I have a class called image, where I have two attributes, UrlDaImagem, and UrlDoThumb, I can save the image, normal only I would like to create a Thumb for that same image, without having to do a…
-
2
votes3
answers458
viewsHow to Update to Linq?
My project has the Delete method, only it definitely deletes the table record in the database. I would like to instead of delete, change the column record, I have a field called "Status", this field…
-
2
votes2
answers209
viewsSlow problems with AJAX in ASP . NET MVC C#
I have a problem of slowness in my AJAX response. I use the following code to search and return a list of results: Javascript function enviaBusca(url) { var resultado = $('#resultados'), mensagem =…
-
2
votes1
answer179
viewsAutomatic filling of Textbox
I have the table AspNetUser in my database that I use to identify and authorize logins. To login to my page, the user always needs to type the [email protected]. It is possible to program the TextBox…
asp.net-mvcasked 5 years, 10 months ago DP WS Receptivo 77