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
answer751
viewsCS0266 error Cannot convert implicitly
When trying to make a list where you will filter only the 5 largest records by values in descending order I am experiencing this error: CS0266 error Cannot convert type implicitly…
-
1
votes2
answers1192
viewsHow to apply a zip code mask to a datatable column using Javascript?
I have a Datatable in my View Index that has the CEP column that needs to have a CEP mask (ex: 29780-000). Does anyone know how to do this using Javascript? <table class="table table-hover…
-
1
votes1
answer48
viewsProblem with Modal Bootstrap
Hello! My problem is this: This is the button that calls the Modal Bootstrap: <button class="btn btn-default details" data-id="@item.nome"><i class="fas…
asp.net-mvcasked 6 years, 5 months ago DP WS Receptivo 77 -
1
votes0
answers36
viewsRegistration with repeated fields, how to do?
I have a register in the system that I am developing that will have repeated fields, I would like to get help in this implementation. This screen is called Sequence which has the following fields…
-
1
votes1
answer83
viewsAdd Dropdownlist value to the database
I wanted to put a dropdownlist in my view where his List value went to the database, but I only know how to add values to DropDownlist with data from a table, wanted to make a DropDownlist with…
-
1
votes2
answers253
viewsHow to save selected items at check from bank using AJAX, Jquery, and C# MVC?
I have a form that shows me a list coming from the bank in checkbox form. How can I identify which items on the list were marked in the save? I carry it like this: function CarregaSaida() { $.ajax({…
-
1
votes0
answers23
viewsPass parameters to PDF
Hello Developers! This is my Controller public ActionResult PrintList() { return View(); } public ActionResult PdfJardimAtl() { var estrangeiros = db.Tb_estrangeiros_pe.Where(s =>…
asp.net-mvcasked 6 years, 5 months ago DP WS Receptivo 77 -
1
votes1
answer139
viewsHow to get string from Enum on an ASP.MVC grid
I have the following: public enum RegiaoEnum { CENTRO = 1, NORTE = 2, SUL = 3, SUDESTE = 4, CENTROOESTE = 5 } And the following View: @using MeuDominio.Enums; <div class="animate"> <table…
-
1
votes1
answer29
viewsError trying to update data in Asp.Net MVC - db. Entry(Lada) application. State = Entitystate.Modified
I am having problems at the time of editing, more specifically in the lines below, db. Entry(Lada). State = Entitystate.Modified; db Savechanges.(); the update that precedes the lines above, occurs…
-
1
votes0
answers36
viewsHow to use Graphdiff Entity Framework Code First
I have the following tables in my database: Sale Detailing Productsresulture Plots The relationship is as follows: 1 Sale => N Detail 1 Sale => N Productsrelations 1 Detail Spreads => N…
-
1
votes1
answer244
viewsAjax POST does not execute the ASP.NET MVC action
Controller Action public class EstabelecimentoController : ControllerBase { [HttpPost] public ActionResult ImportarEstabelecimentos() { var file = Request.Files["inputFileImportarEstabelecimentos"];…
-
1
votes1
answer616
viewsASP.NET MVC error circular reference when serializing object
Good afternoon dear comrades! I am a beginner in ASP.NET MVC and in C#, I am developing a project and I found a problem. Basically, it’s a store registration system. I have two tables, one called…
-
1
votes1
answer140
viewshttppostedfilebase always empty when passing csv to controller
Boa Tarde Personal, I’m having trouble passing a csv that is being sent from ajax using jquery to the controller where null always arrives. Could you help me? View : @using…
-
1
votes0
answers44
viewsConsume an asmx service from a Rest
How do I pass an object I have in a REST for a ASMX? I have this controller in REST that has the object(client) that I want to send to a ASMX [Route("api/[controller]")] public class…
-
1
votes1
answer159
viewshttppostedfilebase - Bringing null when I have many files with the big name
Good morning Next friends I have a web system mvc with c# and need to upload several files simultaneously. Until then, all right, but when the files have a big problem name I will exemplify. I have…
-
1
votes1
answer132
viewsSQL command blocking controller requests in C# MVC
I am implementing in a C# MVC project, a routine to run the database Store. I’m having trouble that when I start doing the Store, other requests controllers are locked, waiting for SQL to finish.…
-
1
votes1
answer1895
viewsHow to adjust the size of a generic Modal Bootstrap window according to the desired View
I have a generic bootstrap modal window that will open several views. The problem is that each of them will have a different screen size and currently, my settings remain fixed(style="width: 800px;…
-
1
votes0
answers61
viewsTable with drag and drop event does not work in mobile
I have a page that user have the freedom to sort table, and this drag and drop event on computer works perfectly, but on tablets, mobiles does not work, what to do for the perfect workings of this…
-
1
votes1
answer668
viewsPass parameter to another page
Within people, I own the accounts receivable table, where I am calling the accounts receivable create page, and Edit. So far, it’s working perfectly. However, within receivables, I have one select,…
-
1
votes2
answers661
viewsBack to previous page - mvc page Razor
I’m trying to get back to the previous page this way: string urlAnterior = Request.Headers["Referer"].ToString(); if (urlAnterior.Contains("Pagina")) return RedirectToAction(""); else return…
-
1
votes0
answers76
viewsHow to call a precedent using an oracle out-type course with C#
I’m taking a test to figure out how to make a call from a trial that has this kind of course In the past I have this: create or replace PROCEDURE "PTESTE" ( pcd_servicoagendado integer, ptipo…
-
1
votes3
answers135
viewsMVC: parameter in URL is not being passed to controller
I am running the Action below, but the parameter "Artigooucategoria" is not being passed to the Controller. I am working with Asp.net core 2.0. public async Task<IActionResult> Buscar(string…
-
1
votes1
answer228
viewsPick the fields of a Select and pass to viewmodel
Guys I own two Selects Multiple where their function is to change values as shown in the image below: The first in real is a Dropdownlist where he searches the bank’s information, follows its code:…
-
1
votes0
answers214
viewsThe field Valor Pago must be a number. ASP NET MVC
I own this field at Model: public decimal Valor { get; set; } It records correctly, and shows me the value in this way: 10,00 But when I edit, and complete the action, it returns to me : The field…
-
1
votes1
answer198
viewsRedirect Actionresult
Good for everyone. I am trying to redirect from one Actionresult to another and I have tried everything unsuccessfully. At this moment I find myself with the following code: [AllowAnonymous] public…
-
1
votes1
answer121
viewsError using add-Migration command. Using json as configuration file
Good morning! When performing the add-Migration command, to make the migrations, I am receiving the error sequinte: Add-Migration : Exception calling "AddFromFile" with "1" argument(s) : "'basePath'…
-
1
votes1
answer438
viewsError passing parameter through Getasync method
How I pass the object login as a parameter for the method GetAsync ? I’m trying to do it this way, but I didn’t get the error message: private async Task<JsonResult> obterLogin(Login login) {…
-
1
votes0
answers37
viewsHow to take "x_" from Html tags in outlook with ASPNET
I am having the following problem when sending an email with my application, at the time of opening the email, the Outlook provider modifies the template tags by putting the "x_" at the beginning of…
-
1
votes1
answer849
viewsPrevent duplicate registration with C#
I’m having a hard time with the duplicity record. How do I so that after the user fills in the form, at the time of saving, the data is compared to what is in the database, if he has any repeated…
-
1
votes1
answer1616
viewsThe field Sale Price must be a number. MVC
I have a field, price sale, that model is like this: public decimal PrecoVenda { get; set; } In Viewmodel he is like this: [Display(Name = "Preço de Venda")] [Required(ErrorMessage = "O campo {0} é…
-
1
votes1
answer785
viewsOpen partial view by passing parameter
I am doing some tests on ASP . NET CORE 2.0 and I have the following question. I have an Index (View) that is displaying a list of `Users`. And from the click of a button `Edit`, I rewrite my…
-
1
votes1
answer144
viewsExport a Jquery bootgrid to Excel
I searched here on Stak and online, and I have seen some articles and tips on how to export an HTML table to excel. But in my case, I think it’s a little different because I’m using Jquery Bootgrid…
-
1
votes0
answers77
viewsObject comes null in query, even if existing
I have this method in my controller [HttpDelete] public HttpResponseMessage DeletaCidade(int id) { Cidade cidade = banco.Cidades.Find(id); if (cidade == null) { return…
-
1
votes2
answers1101
viewsDisplay modal after form validation (fields filled)
I have a form with several fields that are mandatory. By clicking submit, validation is performed using jquery validation and being ok, send to the controller (ASP.Net MVC). I need that after the…
-
1
votes2
answers396
viewsGet next record on a grouped foreach
How could I be selecting the next record within a foreach grouped before it ends, without advancing on that loop? The point where I think I might be getting this information is where it’s written…
-
1
votes1
answer674
viewsASP.NET MVC Pagedlistpager pagination with more than one parameter
I have the following page using x.Pagedlist @using AspNet.Models; @using X.PagedList.Mvc @{ ViewBag.Title = "Visualiza"; @model X.PagedList.IPagedList<AspNet.Models.Pessoa> } <h2>Pessoas…
-
1
votes2
answers103
viewsTransforms string to decimal within an object
I made a Viewmodel, where in the database the CPF field is decimal(11.0) and in the VM I put as String. In my API the CPF is decimal. Well, when I fill out the field and send the form to the API,…
-
1
votes1
answer59
viewsHow to get the Controller to pick up the "Linktext string" text from @Html.Actionlink
In my application arose the need to make a same Controller call Sort has the Reclassification function, with this, I want the ControllerClassificar get the string LinkText of @Html.ActionLink to be…
-
1
votes2
answers137
viewsShow Groupby List using Lambda in view. ASP.NET MVC
Well, I’m having a little bit of a problem here. I consult at the bank using Lambda, and use the tag GroupBy,query is bringing objects correctly, the problem, is that I can’t show in view. gives an…
-
1
votes1
answer1014
viewsOpen PDF Base64
I have an application that generates a PDF in bytes and converts it to ToBase64String and sends astravés of a JSON for javascript to open, but on Chrome it cannot read this file and present the PDF…
-
1
votes1
answer192
viewsHow to implement a Person repository function for the Generic - Asp.net MVC and EF Core repository
I have a function to return the highest value of a table ID field using EF Core. Only that I would like to implement it in my generic repository to be dynamic and to be used by all classes. How do I…
-
1
votes0
answers38
viewsProblem accessing the Controller
Apicontroller [Produces("application/json")] [Route("api/[controller]")] public class ClienteController : Controller { private IClienteRepository _ClienteRepository; public…
-
1
votes1
answer224
viewsError building with Jenkins and Msbuild
I’m trying to create a build job in Jenkins, I’ve already set up the folder where he searches the Msbuild.exe and also the plugin however at the time I put it to run gives this error: ` C: Program…
-
1
votes1
answer645
viewsPrepare mobile responsive Iframe or embed
Guys I have a project c# MVC5 and my scenario is as follows: I have to open in a friendly url a large series of pages (with media content) made by third parties. One at a time clear (according to…
-
1
votes1
answer451
viewsAligning fields with bootstrap inline-Forms
Good afternoon! I don’t have much experience with frontend, but I’ll have to turn around to finish a project, so I’ll need a little help. My question is, I have a few presses on the screen, and I…
-
1
votes0
answers79
viewsASP Net MVC - Insert html helper into string and render via Html.Raw
Fala galera, I have the following situation: I have a list of links registered in the database, which will be loaded according to the user’s profile. I’m currently obligated to do so:…
-
1
votes0
answers96
viewsInaccessible link on IIS
I’m making a C# application using the MVC standard. It uses a Google Firebase database. Running this application by Visual Studio debugger works normally, but when trying to publish it in localhost,…
-
1
votes1
answer189
viewsHow do I pass a View value to the Controller in Asp.net core?
I want to go from View <table style="width:100%"> <tr> <th>Serviço</th> <th>Data</th> <th>Feito</th> </tr> @{ foreach (var item in…
-
1
votes0
answers31
viewsSave photo in MVC
I’m trying to save photo in the database by following this link, but it’s not working. Here is the HTML code: <div class="form-group"> <label asp-for="Foto"…
-
1
votes1
answer61
viewsDownload file with mvc is giving dick
I did several searches on the net to find a way to generate a spreadsheet and save to disk. As it comes to web, this can only be done via download, and all the examples searched (at least by me), I…