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
-
1
votes1
answer1130
viewsChange Label in view in Asp.Net MVC Project
I created a class in the Model called Payment.Cs, where it has the attributes exactly written as the name of the fields in my payment table in the BD. I created a view to register the payment…
-
1
votes1
answer396
viewsEntity Framework vs SQL Injection (security?)
Hello! I’m new to development so excuse me if the question is silly. If it’s thanks link’s with references so I can better inform myself. As much as I understand the concept and the use of SQL…
-
1
votes1
answer345
viewsWhen running the POST passing object via the URI of a Webapi, the object arrives as null in the method
I am a few days beating head with this problem I have a fronted MVC5 application and it sends an object to another Webapi application in a Save method(). See the code of my Frontend application that…
-
1
votes1
answer76
viewsLike I create a Dropdownlist for MVC5 ASP.NET
Hello I’m having difficulty making a Dropdownlist, I have 3 classes a Entities to have relationship with the bank, A Gender that is associated with the Work class. [Table("Generos")] public class…
-
1
votes1
answer234
viewsC# MVC5 EF - How not to lose data after Modelstate validation?
below my question if you can help. I use C# ASP.NET MVC 5 with Entity Framework. I have classes that represent below respectively a customer registration and an email registration: public partial…
-
1
votes1
answer1020
viewsThe parameter dictionary contains a null entry
I am with the problem that is the following, I am consuming a service where it receives a parameter as input, in the frontend I send this parameter via ajax, but it returns as error and says that I…
-
1
votes1
answer49
viewsUpdate only a property of an object using Outputcache in Actionresult
Hello, everybody. I’ve got a problem I don’t even know if there’s a solution like this. I have an Actionresult that returns the contents of a chart in Jquery. The result of this chart will always…
-
1
votes0
answers22
viewsI cannot map EF
I have this entity in my domain: public class CalibrationToolActivePart { [Key] public int CalibrationToolActivePartID { get; set; } public int CalibrationToolID { get; set; } public int…
-
1
votes2
answers241
viewsValidation in Edit and Delete operations by ID at url
I tested by taking the id and passing via url, normally performs the operation as long as it exists, otherwise error as expected. EX: http://localhost:55199/Person/Delete/7…
-
1
votes0
answers259
viewsHow to edit data from a table in a modal bootstrap?
How to load a modal bootstrap through a link within a tag < td > and send together column value Code, Name and Date example: jquery: $(document).on("click", "#lnkEditar", function () {…
-
1
votes0
answers41
viewsHow to return undeclared View values in Model to Contoller by post method
My controller is declared as code below: public ActionResult Create([Bind(Include = "a,b,c,d,e")] Proposal proposal, int prjId, int[] array) { if (ModelState.IsValid) { proposal.f = prjId;…
-
1
votes1
answer442
viewsHow to select multiple radios button in the same column of an html table?
I have a table html with 3 columns and 3 rows and when I select, for example radio button of line number 2 the line number 1 unchecks. @if (Model != null && Model.Tabela1!= null &&…
-
1
votes1
answer169
viewsError While Running Migrations
Friends, I have two entities Deliveryfee and City, where Deliveryfee has a FK from City, when I went to withdraw the relationship between the two and ran the Migration he returned me the following…
c# asp.net-mvc entity-framework asp.net-web-api migrationsasked 7 years, 1 month ago Thiago Ubiratan 353 -
1
votes2
answers51
viewsFiltering through empty children
I have two entities (TipoDeRequerimento and TipoRequerimentoSituaçãoAcademica) in my query. Today I can make a filter to bring the Types of requirements that have a certain academic situation…
c# asp.net-mvc asp.net-web-api lambda-expressions linq-to-entitiesasked 7 years, 1 month ago Thiago Ubiratan 353 -
1
votes1
answer2364
viewsThe template item inserted in the dictionary is of type 'System.Collections.Generic.List`
I am developing a project where I have the Patient class inherited from the User class and I am using the Entity Framework to map the database tables by type (TPT), when I try to access the Patient…
-
1
votes1
answer210
viewsEviar view parameter for action
I have a views that lists my users, is basically in the pattern generated by Asp.net mvc with Entity, the data is in a table, and within this table I have a : @Html.ActionLink("Aprovar cadastro",…
-
1
votes1
answer114
viewsError trying to change a user’s role
I am getting the following error while trying to change a user’s role : Server Error in Application '/'. UserId não encontrada. Descrição: Ocorreu uma exceção sem tratamento durante a execução da…
-
1
votes2
answers3639
viewsExport of CSV data
Personal someone would have some example of how to create a web data export on . CSV? I already have one on my system on . XLS, but I need to modify it, someone can help? Controller private void…
-
1
votes3
answers3345
viewsGo through jquery inputs and check if you have a certain class in input
I’m picking up the inputs with the code var itensTabelaPresentation = ('#tabelaPresentarion > li'); and would like to walk through them and go checking if they have certain class, how do I…
-
1
votes2
answers46
viewsDoubt with data return Asp.net API
I have a method that makes the record insertion, after having inserted precise return the id that was recorded, more is not returning the information. I appreciate the help. [HttpGet]…
asp.net-mvcasked 7 years, 1 month ago Harry 3,805 -
1
votes1
answer928
viewsASP . NET MVC - Windows Authentication - Browser Authentication Form
I am developing an ASP . NET MVC application whose access permissions will be managed from parameters set for users on Active Directory (AD). To search for this data from AD I developed methods that…
-
1
votes0
answers773
viewsHelp with error Non-static method requires a destination when creating txt file
I have a C# code that creates a txt file and then downloads it. The code works very well on my local machine, but when uploading it to the server, it gives an error: Non-static method requires a…
asp.net-mvcasked 7 years ago Italo Rodrigo 4,344 -
1
votes0
answers147
viewsHow to compile C# code at runtime in an ASP.NET MVC5 project?
I tried to use the CodeDom, but when trying to find a DLL specific to execute my code the command Assembly.GetEntryAssembly().Location always returns to me null. It seems the projects ASP.NET are…
-
1
votes2
answers2277
viewsPass jquery parameters to Url.Action ASP.NET MVC
I’m having trouble assembling a URL with parameters. Until then I managed using the @Url.Action, but the second parameter dataPesquisa is going nil. I imagine when the parameter passed directly to…
-
1
votes1
answer282
viewsEF6 MVC5 C# - How to maintain filters with Querystring page
Good afternoon, I have several pages where the user can filter through 5 different fields and when the user clicks on the form search button, which is configured with the GET method, the search is…
-
1
votes1
answer458
viewsPartialview relationships Asp.net mvc 5
I’m having trouble creating the logic of registering models that has relationship between them. One exists only the reference, but in the other the reference is of type List<>. I created a…
-
1
votes1
answer4041
viewsHow to pass Viewbag values to a Javascript Function in an ASP.NET MVC application
I have the following Actionresult Controller in my application. In this Actionresult I have two Viewbag that captures a Longitude and Latitude values from a Google API. The values arrive perfectly…
-
1
votes0
answers94
viewsActionresult search result does not return all results for View Pagedlist
I noticed that on my application before adding to View the Paged List he received all items returned from Actionresult responsible for the research, then from the implementation of the Paged List I…
-
1
votes1
answer185
viewsWhy does this @Html.Dropdownlistfor not accept htmlAttributes?
I have a read-only view in some cases. I don’t want to use javascript as it can be disabled on the user side. At last... When I do this (for testing) it works perfectly. <div…
-
1
votes1
answer81
viewsForeach in an Actionresult of details
I have an entity Registering who owns a Professor, the Professor has a list of Registering. How can I create a foreach in View details of Registering to list the name of Professor which belongs to…
-
1
votes1
answer29
viewsGo to a new view with Json
I am deleting with Ajax and returning a Json. How do I open a different view? Follow the code, put the url no longer works: View $.ajax({ url: '@Url.Action("ExcluirPedidoCompra")', // to get the…
-
1
votes2
answers537
viewsShow error message when Modelstate is not valid
When I submit the form it recognizes that the ModelState.Valid is invalid but when it returns to View() does not show the error messages I put in Model. My Controller : [HttpPost]…
-
1
votes0
answers288
viewsUsing multiple html pages with the same Angularjs + ASP.NET MVC controller
Using the routes with Angularjs, When entering the Author.html page with the route /Autor, is listed all authors registered in a table where a link is created for each author’s edition, according to…
-
1
votes2
answers126
viewsHow to insert a Where into a Linux query
I have the following query: var result = (from line in db.ApadrinhamentoListas group new { line } by new { line.datahora, line.valor_doacao } into grp select new { DataHora = grp.Key.datahora, Valor…
-
1
votes1
answer82
viewsASP.NET MVC - Label does not display because of "dot" character at the end of the name parameter
I had a problem where a label didn’t appear on the page I was creating with Razor. I discovered that the problem was because the "string name" parameter had a dot at the end. I wonder if this is an…
asp.net-mvcasked 6 years, 11 months ago Rafael 139 -
1
votes1
answer22
viewsError after View is called
I have a login screen with the following call when the user clicka on the button "login" $(document).ready(function(){ $("#formLogin").on('submit', function (e) { e.preventDefault(); var form =…
-
1
votes2
answers1243
viewsReceive images in ASP.Net Core and save to Entity Framework
Good afternoon, Can anyone tell me how to get an image on ASP.Net Core ? I have the html page that tries to send to the server: <form method="post" enctype="multipart/form-data"…
-
1
votes1
answer87
viewsRule Rewrite Changing script directories
I have the following problem, when using the Rule below my default directory is changed and mine js scripts and files css stop working. <rule name="Produtos Detalhe"> <match…
-
1
votes2
answers3016
viewsDoubt with Webrequest get method passing token
I’m trying to read the data of an order, where I send the information via get, Error: Unable to send content with this verb type. public string ConsultaPedido(string urlpedido, string NumeroPedido)…
-
1
votes1
answer1370
viewsHow to read a JSON file using C#?
I have my code that reads an external API and returns me the information, I would like to read this information or add them in a class: I’m using Newtonsoft.Json; This the Json: { "success": true,…
-
1
votes2
answers384
viewsApi that receives an Item Array
I have the following situation, I need to create an API that will receive the content below: { "numeroCarrinho": 122865, "itens": { "PA00058": 1, "MA00068": 1, "PA00004": 1 }, "cep": "41706670",…
-
1
votes1
answer162
viewsHow to read class data
I have an api that when receiving the data fills a class, I want to do a while in this class tb_dados_api and tb_carrinho, take the data to record in the database, how could I do that? Thanks Here I…
-
1
votes0
answers211
viewsHow to check customer validation on in an ASP.NET Core MVC 2.0 application to recognize EN standard
I’m having trouble setting up client-side validation gift my app. I’d like customer validation by using jquery.validate.unobstrusive, accept numbers and dates located in. I have already made this…
-
1
votes0
answers306
viewsSearch for an item in the Aspnet mvc List
I have a controller, in this Controller has a action List, to which it returns all suppliers. In the view List, I created one input type="search". I want that when searching a name in this field, it…
-
1
votes1
answer87
viewsHelp with ASP MVC routes (3 routes for the same action)
I have a controller: public class imoveisController : Controller { public ActionResult Index(int idEstado = 0, int idCidade = 0, int[] idRegiao = null) { string IdEstado; string IdCidade; int[]…
-
1
votes2
answers190
viewsIn Development Code First how do I relate the Aspnetusers table to other tables
I am developing a system for real estate and need to relate the Table Aspnetusers with the tables that the system will have and with cardinality one for many, this I want so that the system can pass…
-
1
votes1
answer99
viewsPredefined type 'System.Valuetuple 2 is not defined or Imported
I am using Asp.net mvc and in my controller, I have the code below: [HttpGet] public JsonResult salvaItem(items item) { items oItem = new items() { address = item.address, bairro = item.bairro };…
-
1
votes1
answer99
viewsError while trying to save data to two tables at the same time
Good morning. When updating a table my system has to save the current data in a historical table and only later save the form data in the table by doing the update. This is the action that receives…
-
1
votes1
answer40
viewsI’m trying to dropdown html
I’m trying to implement a DropDownList in a View mine that serves for form, but I need the selected value to go to a ViewBag. This is my View there where it is "Car Selected", I would need to turn…
-
1
votes2
answers2588
viewsC# Call Controller method Asp.Net MVC5 with Ajax
Hello, I have a method called GetData() in my Homecontroller that returns a JSON, I would like to pass the data to my View, but it always comes empty, I’m starting as a developer, and I’m already a…