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
answers248
viewsHow to upload a file to the server - Asp . net MVC
Good afternoon, I did a small project on Asp . net whose only goal is to select a file on my computer and save it on the server. The problem is that I am unable to perform this procedure after…
-
1
votes2
answers128
viewsSession variable always returns Null Asp.Net
Business Class: public class Empresa { public long empresaId { get; set; } public string nomeEmpresa { get; set; } [Display(Name = "login")] [Required(ErrorMessage = "Informe Seu Login",…
-
1
votes0
answers54
viewsJsonserializationexception, Error converting JSON
I am trying to deserialize an object brought by my webApi, tested with other objects and works, but with this no The error is as follows: Jsonserializationexception: Unexpected JSON token when…
-
1
votes2
answers137
viewsHow to treat Timestamp field return via AJAX?
How to convert this sequence of numbers: 1555506548000 into a valid date ? I need to make the following comparison: if (_valor[0] == item.DT_CRIADO_EM) { //Faz alguma coisa }; However the date is…
-
1
votes1
answer100
viewsError while trying to render a partial view in a view
I have a View(cshtml) and I need to call a partialView. This Partial is a table with the logs of that Sale, which will be viewed in tabular format at the bottom of the View. The problem is that when…
-
1
votes1
answer57
viewsProblems creating Postgre backup on Asp.Net MVC
I didn’t find much information about creating Postgre backups with C#, so I created this post. The process is simple... I am creating a process that executes a command and passes some parameters…
-
1
votes1
answer236
viewsForeach in a Viewbag is not working properly
Inside that foreach @foreach (var item in Model) { <tr> <td> <h3 id="subscription-@(item.SubscriptionId)" data-id="@item.SubscriptionId" class="item-accordion result-header">…
-
1
votes1
answer133
viewsProblem downloading a file with an accented name
I have a function that returns a file to download, when the file name has accented characters and a certain size, the downloaded file comes with the wrong name (in Chrome comes the name of my…
-
1
votes1
answer52
viewsAdd message in Oauth reply
I created a web api with token validation that works correctly, my problem is: I would like to put a message after the mandatory information, I leave attached an example image(I would like to add…
-
1
votes1
answer185
viewsPage not found Error 404, [Route("Categories/list/{page=1}")] in Asp.Net MVC
Hello, I have a problem regarding the configuration of Route in Asp.Net MVC. The problem is that I created a test page where on this page I am trying to configure the route resources. I set up a…
-
1
votes1
answer230
viewsHow to run an Alert only once in an Asp.net MVC View
I have a project in Asp.net mvc and in my view has an Alert that runs whenever the page is loaded (it closes automatically). The problem is that every time I make a Submit and the view is reloaded,…
-
1
votes0
answers46
viewsJavascript in file running intermittently
I am using javascript to perform ajax requests every time an item is selected in a combo. For this the Select tag executes the Onchange event. However, I am having problems calling the js function…
-
1
votes3
answers1381
viewsHow to declare an object parameter as null in C#
I have the following class in C# namespace Projeto.Models { public class Biblioteca { public int Id {get; set;} public string Nome {get; set;} public Livro Livro {get; set;} } public class Livro {…
-
1
votes0
answers22
viewsjQuery - ASP.NET - Fields not accepting values with comma separation and ignoring decimal places
For example, if I type 52,400 the system saves as 52,40 or if I type 5,000, it saves 5,0. I’ve tried everything, but I can’t understand why the system is suppressing these decimal places. My code…
-
1
votes1
answer26
viewsdropdow list MVC, with selected item
I have a dropdowlist that carries RamosDeAtidade, want to know how I do to my Edit view, already be selected the branch I registered, in my Controller, at Action Edit It’s like this: var cliente =…
-
1
votes0
answers40
viewsGet a company record
I am new in c#, I would like help to pick up and registered company by user X, what I need is the function Businessman Functioncontroller public async Task<IActionResult> Create() {…
-
1
votes0
answers118
viewsdatepicker calendar opens and closes when you click the form Submit button
Hello. I got a problem here. I have an aspnet mvc form with c# that has two datepicker: <form id="formBuscar" action="PaginaDeDeAcertosDaQuestao" class="form-horizontal box3">…
-
1
votes1
answer64
viewsHow to return the numeric value of a Selectlistitem C#
I need to return a List Selectlistitem where the value property of each item returns the value of Enum (1, 2...) and not the name of the property (physical, juridical...). How do I do that? Function…
-
1
votes1
answer32
viewsblank option @htm.Enumdropdownlistfor MVC5
I’m having a problem in my Razor, I want the option that comes selected is a blank. my Razor is like this: @Html.EnumDropDownListFor(m => m.Endereco.Zona, string.Empty ,new { @class =…
-
1
votes1
answer107
viewsFeed from the list c#
I have a list in my code that is fed as follows: string Recursos = "E-mail, Desktop, Datasul, Aptus"; string[] RecursoArray = Regex.Split(Recursos, @"\W+\s+"); List<Ti01> ListaRecursos = new…
-
1
votes0
answers42
viewsForm does not appear on google maps in expanded mode
I’m a beginner in javascript and css. The program was developed in . net vistual studio. The problem is this: I have a page that has a map where I make a circle in a region of it. The behavior that…
-
1
votes1
answer211
viewsHow to close Bootstrap Modal?
Before anything I say I read other posts... Close modal when you click the button I am developing a system in ASP NET Core and using a modal of bootstrap to log in. I sent the data to the controller…
-
1
votes1
answer99
viewsHow to make the Return Ok<Object> take multiple arguments
Good afternoon guys, I would like to ask you a question, I am creating a method within a webapi in Asp.net mvc to receive some data from the launch of a home visit, but I’m having an error in Return…
-
1
votes1
answer41
viewsValidation Input Aspnetmvc
As I do to validate in the Exit of an Input, I already have the function that returns bool, if it returns false, I can’t let go of the seller.snome field and present an alert message. <div…
-
1
votes1
answer285
viewsError with modal using Partialview Asp Net Core 2.2
I’m getting the following error in my project: Invalidoperationexception: The model item passed into the Viewdatadictionary is of type 'System.Collections.Generic.List`1[Helpdesk.Models.Suppliers]',…
-
1
votes1
answer268
viewsRegistration with Modal and Partialview . Net Core 2.2
In my project I created a button for registration, which calls a modal that is inside a PartialView. The objective is to register through this modal the data informed in the database, the problem…
-
1
votes1
answer81
viewsHow to pass an Enum type parameter together with the Model for a Partialview - Asp.net Core MVC
I’m having a hard time passing an Enum parameter to a Partialview using Viewdata. It is giving conversion error (in Partialview), because the received type seems to be string or other type and is…
-
1
votes1
answer32
viewsCode First Generating a foreign key
I have the following classes public class ControleDeVisitas { public virtual ICollection<TipoDeSistemas> TipoDeSistemas { get; set; } } public class TipoDeSistemas { public Guid…
-
1
votes0
answers128
viewsDisengage Identity and handle Identityuser in the domain - Asp.net Core MVC 2.2
I want to implement Identity on my site, but not the way it comes in the MVC template with auth Individual from . net core 2.2, because I want to handle the Identityuser class on my domain, so that…
c# asp.net-mvc asp.net-core asp.net-identity identityasked 5 years, 2 months ago Márcio Sebastião 769 -
1
votes1
answer47
viewsWhy can’t I map using Automapper?
I have a model called Client with many attributes and (for simplicity I put here only a few) I thought of creating Viewmodels to simplify the display of data in Views, the problem is that the…
-
1
votes1
answer205
viewssearch by ID for each item in the list
I have a class called Attending. in it I have the following attributes: public class Atendimento { public Guid AtendimentoId { get; set; } public Guid? ResponsavelPorAtender { get; set; } public…
-
1
votes2
answers298
viewsShow/Hide Divs using functions - Javascrip and Asp.Net Core MVC
I have two Divs, whose contents will house some Fields specific to my page. I need to keep such Ivs always hidden, so that when necessary, I hide one and display the other and vice versa. For this,…
-
1
votes1
answer2188
viewsNullable Object must have a value
I have this SELECT, where m.EmpresaID may come null: var pesquisa = from pro in db.Produtos join prodempresa in db.ProdutosEmpresas on pro.Id equals prodempresa.ProdutoID into Details from m in…
-
1
votes1
answer36
viewsProblems while removing Row using JS in Asp.net Core MVC
I have a dynamic address registration where the user adds and removes the addresses dynamically. Each Row that is added is inside the "div-addressees". I am unable to remove the Rows ('form-group…
-
1
votes0
answers109
viewsRecover value from an HTTP
I found a question four years ago that "would be" exactly what I need: I have a URL where it returns an HTTP Querystring, and I need to recover URL information and convert into variables to make…
-
1
votes0
answers72
viewsHow to handle an Exception of an http Request in Asp Net MVC
Hi, I have an app on ASP.net MVC who’s making a requisition http through a connection port that is available through a service, which is running on the server. The controller calls the method and…
-
1
votes0
answers133
viewsSave 3 decimal places to sqlServer
Personal I have to save 3 decimal places in my database SQLSERVER, however this saving only 2 houses for example I have a value 0.456 and when saving is 0.450 in the code : using…
-
1
votes0
answers18
viewsWhat exactly is the function of the Identitymodels class in C# and how does Applicationdbcontext work?
I developed an application in C# where I have the class Identitymodels, where from it I created a list of my classes based on Applicationdbcontext. I used Migrations to create the tables in the…
-
1
votes0
answers14
viewsNinject in a Classlibrary and ASP.NET MVC
To understand, I’m going to set the stage. The application uses ninject with repositories and services, but some models have navigation properties, all in the same project In MVC there is the object…
-
1
votes1
answer64
viewsProblems using null coalescing
I’m having trouble using the null coalescing in the case below: When trying to use operand ?? to validate if the value reader["Data"] is void, and if the DateTime.MinValue. The error that returns…
c# asp.net-mvc asp.net-mvc-5 asp.net-core datetimeasked 4 years, 10 months ago Demetrius Pecoraro 36 -
1
votes1
answer51
viewsChange the default value of a Boolean in an ASP.NET select
I have a field on my system that needs to inform if the product is available or not, SQL is as bit( TRUE or FALSE). Entityframework generated a View with a SELECT True or False. <div…
-
1
votes0
answers35
viewsPerforming Groupby with Linq?
I’m trying to perform a Groupby but I’m not getting it. Always returns an Exception that I’m not able to solve. How do I solve this problem ? LINQ public ActionResult MeusConcursos(){ Usuario…
-
1
votes2
answers50
viewsSend selected value in select to mvc controller
The code: $(function () { $('#IdiomaOrigem').change(function () { var data = $("#IdiomaOrigem").val(); var destino = $("#IdiomaDestino").val(); $.ajax({ url:…
-
1
votes0
answers213
viewsCielo’s integration with C# and Asp.Net MVC?
I’m trying to integrate Cielo to make payments on my site "Asp.Net MVC" but I’m not getting it. I read the Cielo integration manual, followed all the steps, performed tests in Postman and works…
-
1
votes1
answer32
viewsAdding 2 rows of fields in a Database using C# (MVC)
I am doing an Actionresult within a control to effect some purchase data. The idea is to buy and sell products (in this case Coins),negativando a Quantidade and positive Valor in case of sale and…
-
1
votes1
answer25
viewsHow to position/align a field (which is inside a div) together with other Fields
Greetings to all! Within my "form-group Row" I am placing Fields with their respective sizes, however, in the middle of them (to be more specific, between the first and the third field) I created a…
-
1
votes1
answer46
viewsField with Datetime format does not change the format to Date - Asp.net MVC
I need to show only the date format in a Datetime field, but only letters are appearing in the field (even if the value property contains a date). VIEWMODEL: [DisplayFormat(ApplyFormatInEditMode =…
-
1
votes0
answers46
viewsWhen closing a bootstrap modal, the unobtrusive Jquery validation triggers unnecessarily
By clicking the Close button of the Modal window, the validation is firing and it does not close. Then, if I give another click, then yes, the modal window is closed. I confess that I am bothered by…
-
1
votes1
answer32
viewsOn which project layer with DDD concept, should I create a function or routine for the reorganization of portions of a receivable?
I have an Asp.Net Core MVC project in which I am developing an Accounts Receivable. The whole project uses the DDD concept. I need to create a function to reorder the sequence of parcel records in…
-
1
votes1
answer101
viewsHow to persist extended Identity(Authentication) fields. net CORE 5.0
I have a project in ASP.NET MVC CORE 5.0 . What I want to do: Retrieve the information dadAleatorio user logged in, in any controller to insert them in wheres and creates. For example I want to…
asp.net-mvc asp.net-core login asp.net-identity database-firstasked 3 years, 11 months ago Jabrel 49