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
answer45
viewsNuget package versioning or Entity Framework versioning?
To create the project I am using the CODE-FIRST methodology, but to do some tests in the bank I had to do a Seeding Service (populate the database directly from the code ) for this I had to make…
-
0
votes1
answer180
viewsAutomatic generation of Controllers and Views with . NET Entity Framework and Mysql
EDIT: I solved the problem below and others that appeared later. See my answer. I created a Business project using the Entity Framework (EF) Code First approach. I have a database in Mysql with 8…
-
0
votes0
answers124
viewsHow to set up Hangfire authentication in Production
I’m using Hangfire to manage background tasks, it works normally when I’m on localhost, but in the production environment I’m not being able to set up the authentication needed to open Dashboard I…
asp.net-mvc asp.net entity-framework asp-net-core hangfireasked 4 years, 11 months ago iago soares 92 -
0
votes2
answers69
viewsSum of values in View
I would like to realize a simple sum of some values in my View. I tried to accomplish it that way: @foreach (ReceitaIndexVM receita in Model) { decimal Total = 0; <div class="col-lg-2…
-
0
votes1
answer46
viewsHow to throw controller errors and capture them in an Ajax - Asp.net Core MVC request
I’m using AJAX to make a request and the return is a Partialviewresult. In the request, I am passing the personal model. Someone knows how to help me? CONTROLLER: [HttpPost]…
-
0
votes2
answers49
viewsHow to make the custom select of the screen "Suppliers" search information (Company name) in the table "Company"
I am developing an Asp.Net application using MVC 5. I have created one select on the Vendors screen and I would like to know how I can get the information from my bank and show them in this custom.…
-
0
votes1
answer73
viewsJS file in ASP Net Core
I created an ASP Net Core project following the MVC standard, in the project there is the folder wwwroot that contains the images, css and javascript same. In the javascript folder has two files,…
-
0
votes1
answer56
viewsFill Dropdownlist with Multiple Values
i am trying to fill a Dropdownlist that has multiple values, from my "Edit" action, where I recover the objects Toonmoves containing One or More Effects and how The Effects May belong to several…
-
0
votes3
answers215
viewsProblems with connectionString in ASP.NET C# CORE
I’m new to ASP.NET with C# and have a problem accessing the information on my web.config. This is the connection tag to the database: <connectionStrings> <add name="someConnection"…
-
0
votes1
answer101
viewsUpload files to Asp.NET MVC 4 - Web API - Http Put Method
So, I have to do a method in my controller for an API that accepts 2 files via PUT (1 json E1 xml for data processing, not to save the files), and I have to send the request via Fiddler.. My request…
c# asp.net-mvc asp.net asp.net-web-api multiple-file-uploadasked 4 years, 9 months ago helloCodingMyOldfriend 1 -
0
votes1
answer321
viewsHow to create an http request in c# Asp.net
I’m wanting to text through this url; https://www.iagentesms.com.br/webservices/http.php?metodo=envio &usuario=iagente &senha=12345 &celular=5199999999…
-
0
votes1
answer101
viewsHow to set the change state of a checkbox switchery using Javascript and Asp.Net Core MVC
I have several checkbox switchery components that are automatically created in which I control the ID manually, in theory, a list of elements. I need to do the following: When unchecking one of the…
-
0
votes1
answer52
viewsHow to sort a list 1 to N with Expression lambda
I need to sort out a list and I don’t know where to start. I tried to apply the code below based on some posts, for example: https://stackoverflow.com/questions/298725/multiple-order-by-in-linq ,…
-
0
votes1
answer425
viewsHow to send data array to Asp.net core controller
I have a screen where I have the registration of some items, in my control I am receiving the data of the array, but it is coming empty. I already tried some options here on the forum, such as…
-
0
votes1
answer31
viewsWhat is the best way to send post to register together with the child elements?
I am creating an Asp.net application with customer registration. I am creating the Create page, which has the client’s own registration fields. However, the customer can have multiple phones. Soon,…
-
0
votes0
answers38
viewsWhy is my application logging out after saving a record? - Asp.net MVC and Identity
When I first created my app (Asp.net core MVC) Identity was installed automatically. All login features, user records, among others, were created automatically. When I log in using my email,…
asp.net-mvc asp.net-mvc-5 asp.net-identity identity-serverasked 4 years, 7 months ago Master JR 1,853 -
0
votes1
answer150
viewsHow to display a message in the view via a viewdata
How to create a message via a viewdata to the view? In the code below I am trying to validate if my user is null, it has to display the error on the screen for the user. Class public async…
-
0
votes1
answer42
viewsDoubt in the Linql
I have 2 tables: one for product and another with a conversion list. Could I make a single connection to the database without having to go to the bank several times? For example, to each product I…
-
0
votes1
answer43
viewsAsp.Net - Read Files
Hello, I need your help again. I’m working on a project that consists of reading XML files and storing the data in a table. I can already do that, but I have a problem. This is an example of an XML…
-
0
votes1
answer77
viewsProblems with Datetime in Javascript with C#
Staff I have a class that gets a start and end date from a Javascript: public object getTime(DateTime inicio, DateTime fim) { ... } I’m going through the dates like this through Javascript:…
-
0
votes2
answers105
viewsMoq function in controller test
After a few hours trying, I arrived at this test code, but still I could not understand well the function of the Mock, and without it works the same way. Note. The intention is to learn TDD with…
-
0
votes1
answer89
viewsWhen publishing the project on IIS no script and css appears, what can it be?
When publishing the project to the server and configure the iis it does not recognize the css and script, it does not from the error, finds the address no longer loads the css and js code. I checked…
-
0
votes1
answer190
viewsAccess a Singleton Repository outside the Controller (Dependency Injection)
I have a Repository instance added as Scoped in Startup and to access the instance I do the dependency injection by the Controller constructor, or by Fromservices. However, I need to access…
c# asp.net-mvc asp.net-core asp.net-web-api dependency-injectionasked 4 years, 4 months ago Jd3 Tecnologia 50 -
0
votes2
answers30
viewsI need to solve an image resizing problem in C#
i am trying to implement a code to do image resizing because currently are uploading very large images on my system, however I am not able to perform resizing proportionally. Follows the code in…
-
0
votes0
answers40
viewstransform wav into byte[]
I need to join three audios. I thought and I chose to turn them into a string of bytes to then concatenate them. However it is giving error in File.ReadAllBytes : "…
-
0
votes0
answers19
viewshow to place date and time on [Datatype(Datatype.Datime)]
Gentlemen, I’m trying to make it easy to enter date and time data for the user,. my class was like this Link >from my class "Query" https://dotnetfiddle.net/ZHPHKK (as the link and image does not…
-
0
votes1
answer22
viewsInclusion of data/ object
I am having a problem in including objects from other classes. What would be the best solution for this? For example, I have a Service class and attributes that are other classes, such as Customer…
-
0
votes2
answers210
viewsError trying to access ASP NET MVC page C#: "HTTP 404. The Resource you are Looking for (or one of its dependencies) could have been Removed"
Hey, guys, a problem I can’t seem to solve. My project is ASP NET MVC5 with C#. I went to create another page in my project and simply when I run it is not recognized. I did the same way I always…
c# asp.net-mvc asp.net asp.net-mvc-5 visual-studioasked 4 years, 2 months ago Rafaela Marraschi 123 -
0
votes1
answer30
viewsHow to return a file to the client?
I need to return a file in my action so that the client can download it. In my current code, the file is being saved on server. [HttpGet] public JsonResult ExibirPrintRPA(int? id) { string _nameFile…
-
0
votes1
answer142
viewsHow to assign a value to a select option (HTML element) and display data associated with that value? ASP.NET
I have a select that is being 'populated' as follows in my ASP.NET application: <select id="id_select" class="form-control"> @foreach (var x in listay) { <option value = "@x.nome">…
-
0
votes1
answer90
viewsLogin method that receives user data
I’m doing a project and trying to create a simple login method I have the following class User public class Usuario { public int Id { get; set; } public string Nome { get; set; } public string Login…
-
0
votes0
answers20
viewsASP.NET Index (Controller) method that only runs when I want
good night. First I apologize for the ignorance, I am beginner as a developer. From what I understand of ASP.NET, it will automatically run all void methods of my index when this index is called.…
-
0
votes0
answers36
viewsSignalr Error: The connectionid is in the incorrect format
I have a web application that uses Signalr to display server notifications whenever a report is sent. Recently I have received the error below, but searching the internet did not find out what can…
-
0
votes1
answer171
viewsConsuming API with Refit C#
Good guys, I’m having a little problem consuming an API. I am with an Aspnetmvc web application and need to consume an API. First with a user selection I run this method below in the controller:…
-
0
votes0
answers40
viewsHow to verify if a value exists in an Oracle Process input parameter and make a decision?
I have a trial that has a type VARCHAR2 of entrance parameter: PROCEDURE PRC_MINHA_PROCEDURE ( PI_ID IN TB_1.ID%TYPE PI_ID_ATRIBUIDO IN VARCHAR2 DEFAULT NULL, PO_TP_RESULT OUT t_cursor ) AS…
-
0
votes0
answers29
viewsValidation for Dropdownlist in ASP.NET MVC
I’m doing a project, I was doing a Dropdownlist that takes the database data and shows the user. To some extent everything went well, but it lacks a part of treatment, or a validation, because every…
-
0
votes0
answers20
viewsId value is not changing in ASP.NET MVC 5
I am creating a CRUD in ASP.NET in my project, however, started to give a problem. When I try to delete a Product, it passes the totally different Id to the other View, an Id that does not match the…
-
0
votes0
answers63
viewsDecimal is not accepting decimals - ASP.NET MVC 5
I am doing a project in ASP.NET, but it started to give a problem, the field only accepts to receive integers, every time I put a decimal number, for example 20.10, it simply does not let me insert…
-
0
votes0
answers40
viewsProblems serializing a form and making a Viewmodel Post using Ajax - Asp.net Core MVC
I’m making a Submit using AJAX, but I’m having problems because it’s giving error 404 and I’ve tried to do several ways to use JSON.stringfy, use [Frombody] in the controller action, etc. Can anyone…
-
0
votes0
answers31
viewsI cannot get the Selected Dropdownlistfor element inside a Partialview to send to the Controller via Actionlink
Hello I have a Partialview that is filled with selected entries through previous filters. partial view is no more than the presentation of a table with multiple rows in which each row will be a…
-
0
votes0
answers41
viewsShopping Cart Doesn’t Let You Add More Items After Cleaning It
I’m making a shopping cart for an E-commerce test on ASP.NET MVC, working with EF6. I was doing the logic, the cart it adds products and also removes. However, every time I add several products, and…
asp.net-mvc asp.net entity-framework asp.net-mvc-5 entity-framework-6asked 3 years, 11 months ago Leo 29 -
0
votes1
answer39
viewsERROR: cannot Convert from 'int' to 'CRUD.Models.Times'
hello! I am doing a crud project on Asp net mvc and my code presents the following error: Severity Code Description Project File Line Suppression State Error CS1503 Argument 1: cannot Convert from…
-
0
votes0
answers251
viewsValue cannot be null. Name of parameter: entitySet
I am trying to make a project of an e-commerce of Petshop in ASP.NET MVC with Entityframework. Everything was going well, until suddenly, when I tried to register or even list Vendor, this error…
asp.net-mvc entity-framework asp.net-mvc-5 visual-studio entity-framework-6asked 3 years, 12 months ago Leo 29 -
0
votes1
answer50
viewsHow to put an ID in a variable? ASP.NET MVC
I currently have a view where a Table(Orders) is being loaded another table(Colors) I want each order to be a list of the color that has the same ID as the order. My Tables: public partial class…
-
0
votes1
answer35
viewsRegistration game with Postman
Hello, I’m trying to make a registration of a game but when I try to run by Postman it does not work and says that everything is null Code [HttpPost] public async Task<IActionResult>…
-
0
votes0
answers52
viewsUnit Testing . net MVC - Httpcontext Problem
Good afternoon, I have the following application as Solution: Controller: public ActionResult Index() { string username = HttpContext.Current.Request.LogonUserIdentity.Name; UtilizadorDbo…
-
0
votes1
answer43
viewsHow to reuse an Enum on other screens containing some different properties
I’m working with a screen "Financial" and another screen "Financial Report". For the Financial screen, I created an Enum with the options "Accounts Payable and Receivables". public enum…
-
0
votes0
answers12
viewsNameandidprovider does not find reference in the class context - ASP.NET Core MVC
I need to do a custom implementation for the input field, so I created the following class: [HtmlTargetElement("input", Attributes = "tm-for", TagStructure = TagStructure.WithoutEndTag)] public…
-
0
votes0
answers69
viewsLoad a partial view into the modal bootstrap
Following , I’m trying to load my partial view into the modal but I’m not getting it. I’ve tried several ways, including with the @Html.Parcial , However, if you do so, the string company_details…
-
0
votes1
answer31
viewsI cannot return ID when entering data via ASP NET Controller POST
I have the code below, and I need the ID returned as soon as I insert the object. If there is already a registered project, it does not do the insertion, but I need to return some data as empty or…