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
votes0
answers74
viewsI can’t use two models in one with cshtml
I need to load a dropdown, but the dropdown data comes from one model and cshtml is from another model. So I created a model that was common to both of us and I decided on this model, the two models…
-
1
votes1
answer500
viewsHow to pass a URL in the Parameter of an API
How to pass a URL to an API public class HTTPController : ControllerBase { [HttpGet("URL={URL}")] public JsonResult GETURL(string URL) { } } However when passing for example https://google.pt this…
-
1
votes2
answers702
viewsDecimal value conversion error in Insert C#
I have an Insert that receives some parameters, more at the moment that mount the sql statement this giving conversion error: Error Converting data type varchar to Numeric.…
-
1
votes3
answers154
viewsHow to "mount" a multiple variable?
Would it be possible to mount a variable to pass a value to it? For example: var teste0 = "valor"; var teste1 = "outro valor"; var teste2 = "mais um valor"; for(int i=0;i<3;i++){ teste+i = "mudou…
-
1
votes1
answer62
viewsList names in a query and send to a Viewmodel
I wanted to list the names belonging to a group and send to a Viewmodel and be collected by a View(details). Problem: 'Iqueryable' does not contain a Definition for 'Catechetizing' and in the…
-
1
votes1
answer5782
viewsHow to resolve error 405 method not allowed on the server?
I developed a web api, go up the server is of all methods the only one that does not work is to delete, I did a search on the internet is to find out: When you search for the default document, you…
asp.net-mvcasked 8 years, 10 months ago Harry 3,805 -
1
votes1
answer1175
viewsHow to take the value of a Dropdownlist to choose the action to be executed
I ask for your help to help me to assemble the following situation: I have a structure in EF database first where I have a type that the user must select and after selecting this type in the…
-
1
votes1
answer116
viewsForeach of a Class properties and display in the View
I have a view on Asp.net mvc as follows var Maquina = Model.ListMaquinas; @Html.DisplayNameFor(x => Maquina.Property1 ) @Html.DisplayNameFor(x => Maquina.Property2 ) ... @Html.DisplayNameFor(x…
-
1
votes0
answers19
viewsIF not entering condition
Debugging the system code I am maintaining, but I noticed that "if (_start + 15 >= _Count) Return;" does not allow the code to continue, it goes back to Return. What would be the suggestion to…
-
1
votes1
answer69
viewsCalling a view in a subfolder
Hello, everybody. I created a view, inside a subfolder like this example: Views | Home | Minhasubpasta Myview.cshtml In the controller, I have the following method that should call this view in the…
asp.net-mvcasked 4 years, 9 months ago Hugo 39 -
1
votes0
answers34
viewsHow to access Device through Browser - ASP . NET MVC
Good afternoon to all, Staff I am with the following question, how can I access a device/device connected to customer usb through an application made in Asp . Net MVC? The idea is to access a…
-
1
votes1
answer52
viewsHow to select a random string from a list in C#?
Basically, I intended to choose a Random Question from the 'Question List', and when I write the code, it gives me an error in the bold part (the one inside the **). private void EscolhaDaPergunta()…
-
1
votes1
answer191
viewsWhat type used in Postgre to save a large currency field in the format of 000,000,000,000.00
I am developing a web application in Asp.net and need to save a monetary value in decimal format in C# and store it in postgre in Numeric format, and the value is great. It’s a need that came up in…
-
1
votes1
answer176
viewsI can’t find the Web form ASP.NET in Visual Studio 2019
Hello, when trying to add a web page with extension aspx in Visual Studio 2019, I can’t find it to add, as image: Something like this image should appear: I appreciate anyone who can help me.…
-
1
votes1
answer415
viewsDoubt with return time formatted Asp.net mvc
In the application I have a query that compares the current server time with a pre-set time - saved in a table: select CAST(HORA_FECHAMENTO AS datetime) as HORA_FECHAMENTO,…
-
1
votes0
answers120
viewsWhat is the best way to replace a specific Web Api method for MVC architecture?
How best to replace the following method Sys.WebForms.PageRequestManager.getInstance().add_endRequest() Webform for MVC Structure?…
-
1
votes1
answer234
viewsWhat is and what is the difference between IIS Local and IIS Express?
What makes the "Create Virtual Directory" ?…
-
1
votes1
answer16
viewsHow do I deactivate @Editorfor?
I’m doing a project of CRUD in ASP NET MVC in the part of editing the information the team code is being pulled from the bank and is appearing in the @EditorFor and would like to make it so that it…
-
1
votes0
answers20
viewsWhy doesn’t Data Annotation recognize Datetime?
The view is not recognizing the date on formed {dd MM yyyy},ex:31/12/2020 . I’m already cracking my head for hours. *[Required] [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString =…
-
1
votes0
answers28
viewsANGULAR AND ASP.NET together on the front end
I have a question, is it possible to use Asp.net and angular in the front end ?? type one page is in Asp.net and calls another which is in angular ?? Because I am working on a current project where…
-
1
votes0
answers14
viewsCommunication with Arduino via await async . NET
Good afternoon! I’m studying the best way to communicate my web project with an Arduino board. So far I’ve managed SEND an asynchronous form of a command, according to the code below: //metodo para…
-
1
votes1
answer787
viewsAllow typing inside a Dropdownlist and run the search
I have a DroDownList that lists Patients' names. I need to allow the user to type the patient’s "Name" directly into the Dropdownlist and when typing the Patient Name the system will perform the…
asp.net-mvcasked 8 years, 10 months ago hard123 2,329 -
1
votes1
answer338
viewsAbort an Ajax request
In a situation where I use the ASP.NET MVC, can cancel a request AJAX depending on the response of a modal? I am doing something like this: function atualizaStatus(sel, id) { var $status =…
-
1
votes1
answer647
viewsRelative Path with virtual subdirectory
Good afternoon, I’ve been searching the internet for solutions to this my current problem with paths, but I can’t find. Imagine that I have the following links: www.site/Files/Uploads/image.png…
-
1
votes1
answer617
viewsView with 2 model inside a Viewmodel
Goal: Manipulate 2 model in the view using a Viewmodel. I made a Viewmodel to encapsulate the 2 models, but I can’t use one of them. Viewmodel: public class BoletoConfigViewModel { public Boleto…
-
1
votes2
answers525
viewsPath null parameter
I’m trying to get into a controller, receive a parameter and print it in the View by a ViewData or ViewBag. My Controller: public ActionResult Index(string information) { ViewData["Bag"] =…
-
1
votes1
answer206
viewsJsonresult request with decimal type
Because when sending a request with a decimal type (3) the "Point" is deleted, see in the field INSS which is a decimal value, for example: I type 1,69 when making a bind in the template the stitch…
-
1
votes2
answers86
viewsModel, relationship with Dataannotations
If I have an entity Customers public class Cliente { public int ClienteId { get; set; } public string Email { get; set; } public string Nome { get; set; } } If I create a Boleto entity public class…
-
1
votes2
answers112
viewsSESSION: System confuses users who access it simultaneously
When 2 users access at the same time the system, somehow it confuses the users, not only the name, but their permissions as well... I am assigning the session after logging into Actionfilter public…
-
1
votes1
answer1022
viewsPass text from a textbox via parameter in onclick
I need to pass as parameter the content that is in a textbox, in the onclick of a button. How can I do this? This is the HTML code: <div id="popup"> <table width="300" height="160">…
-
1
votes1
answer46
viewsHow do I add a month to the current date with jquery
Good afternoon, How do I add a month to the current date: Example the user types 4 in the input qtdParcela: var _data = new Date(); $("#qtdeParcela").on("change", function () { var _qtde =…
-
1
votes2
answers266
viewsCreate tooltips using Attributes
I created a custom attribute called Tooltip. I would like to add tooltips to any property that has this attribute. Example: In my model I have the following property: [Required, ToolTip("Neste campo…
-
1
votes0
answers93
viewsKendo UI - Multiselect with remote data source
I’ve been racking my brain with multiselect of Kendo UI. Every time I return the list with my information action, the plugin fails to understand the information and returns me the following error:…
-
1
votes1
answer855
viewsC# Error Nullreferenceexception in Tolist() method
I am working on a C# MVC WEB project with Entityframework. I was able to configure it together with the database and also installed Ninject. The first controller I’m working on is Users. I want to…
-
1
votes2
answers190
viewsRU with TPT inheritance and audit fields
Hello. I’ve looked for answers in TPT and Entity tags but I can’t find anything like it. My problem is trying to use an inheritance model (TPT) where tables have fields with the same name (example:…
-
1
votes2
answers376
viewsSubconsulta in Lambda
I would like to do a sub-query today on SQL: SELECT intid as IDCliente, (SELECT TOP (1) int_EP FROM tbl_estagioprocesso WHERE (int_IDC = tbl_Admin.intid) ORDER BY int_ID DESC) AS int_EP FROM…
-
1
votes2
answers769
viewsAdd a datepicker calendar in multiple dynamically generated fields
How to add the calendar Datepicker | jQuery UI and various fields servants dynamically ? This snippet of code is only formatting the mask of input: dd/mm/yyyy, i need to show the calendar when the…
-
1
votes1
answer515
viewsMiddleware with ASP.NET MVC and . NET 4.5
It is possible to add some middleware the routes that will, for example, allow or redirect a user to access the admin panel, which if not authenticated will be redirected to the login area? as in…
-
1
votes1
answer187
viewsPass the Dropdownlistfor value through a @Url.Action
How to pass the value of @Html.DropDownListFor selected by a @Url.Action ?, example: <div class="row"> <div class="col-xs-4"> <label>Cliente</label><br />…
asp.net-mvcasked 8 years, 9 months ago hard123 2,329 -
1
votes1
answer67
viewsJquery does not send the parameter to search
I need to do something like this feature: Jquery Autocomplete jQuery: $("#NumeroContrato").autocomplete({ source: function (request, response) { $.ajax({ type: 'GET', url:…
-
1
votes2
answers1539
viewsPass Select html value to Controller via Post
I have a form where I pass some fields via Helper. Ex: <div class="form-group col-md-6"> @Html.LabelFor(model => model.Nome, new { @class = "control-label col-md- 6" })…
asp.net-mvcasked 8 years, 8 months ago user37440 -
1
votes1
answer1494
viewsA potentially Dangerous Request.Path value was Detected from the client
I’m trying to submit an action with a parameter like this: <a href="@Url.Action(@"Create/?reference=01/04/2016", "Cobranca")" But it generates a URL like this:…
-
1
votes2
answers130
viewsRemoving part of the link on ASP.NET MVC routes
My Routeconfig is configured this way: routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.MapRoute( name: "Default", url: "{empresa}/{controller}/{action}/{id}", defaults: new { empresa = "",…
-
1
votes1
answer966
viewsInsert via Entityframework error "IDENTITY_INSERT is set to OFF"
I have several models and for some reason one of them presents the following error: Cannot insert explicit value for identity column in table 'tbl_boleto' when IDENTITY_INSERT is set to OFF. I…
-
1
votes1
answer98
viewsWeb Helper Chart does not appear in the server application
Action that mounts the Chart: public ActionResult GraficoPedidos() { int [] arrayP = new int[12]; int aux = 0; for(int i = 1;i <= 12;i++) { int numero = Convert.ToInt32(context.Pedidos.Count(p…
-
1
votes2
answers1579
viewsNOT IN in Inline using a sub-query
I am using as a basis the answer in: https://stackoverflow.com/questions/432954/not-in-clause-in-linq-to-entities I need to make a query where do not contain (NOT IN) the Ids coming from another…
-
1
votes1
answer170
viewsCustomize Identityuserclaim
I’m trying to customize the Identity Claims table, through the Identityuserclaim class. I am using a mapping, through the Entitytypeconfiguration class, but I get the error: A Configuration for type…
-
1
votes2
answers337
viewsErrors Model State Called Ajax
Good afternoon, I have a registration screen that I am making an ajax call to send the data, however when the user does not fill some field I need to show a field validation error message. In other…
asp.net-mvcasked 8 years, 8 months ago Zica 469 -
1
votes1
answer176
viewsHTML5 rendering with Razor
According to W3schools an input has no tag closure ex <input type="text" name="firstname" value="Mickey"> source: http://www.w3schools.com/html/html_forms.asp In my ASP.NET MVC project I have…
-
1
votes2
answers616
viewsASP NET MVC - Download html table
I have a view that has a whole table structure, by typing the view path in the navigation bar I opened the table. I would like to create a button that downloads this table and saves as . xls Can…