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
-
3
votes2
answers611
viewsSend email using ASP.NET
I would like to know how to send an email using ASP.NET. The idea will be to click on a button called send and send a support mail Thank you.
-
3
votes1
answer636
viewsCOM Interop with Client and Server
Hello, I have a DLL to encrypt data. I need to use the Component Object Model(COM) Interop to be able to communicate two applications and both traffic the encrypted data through this DLL. Searching,…
-
3
votes1
answer4215
viewsError while decrypting string
I have a method to encrypt and decrypt data. I tested it in the Application Console and it works perfectly. When taking this method to the controller, I get following error: Invalid length for a…
-
3
votes1
answer537
viewsInternationalization, Localization and Globalization
I have a project that needs to work with internationalization, where the web application needs to be available at least in portuguese and english, and perhaps also in Spanish. My biggest difficulty…
-
3
votes3
answers1606
viewsHow to request via post for action by AJAX?
I cannot access my action through ajax request: <legend>Procedimento:</legend> @Html.HiddenFor(p => p.CodigoProcedimento, new { id = "codProcedimento", name = "codProcedimento" })…
-
3
votes1
answer174
viewsSource is not recognized in PDF generation
I am using the Itextsharp library to create PDF’s and I am having problems with the source of the document, I have the error "Font is an ambiguous", I have looked in several places and all the…
-
3
votes2
answers607
viewsForeach duplicating the data
I possess 2 foreachs, to search for dates on ViewBags, where I return both in a select. But for each item of the first foreach, it makes a complete loop in the second, thus doubling the values, for…
-
3
votes1
answer4920
viewsBuilding Customizable ASP.NET MVC Menu
I have a menu in my application, but I need to add a configuration screen where the system administrator selects the menu and chooses whether to enable or disable the menu item, for all users of the…
-
3
votes1
answer705
viewsDevelop standard Razor template - ASPNET MVC
I am with an ASPNET MVC5 project using C# which by design definition was agreed that the Layout of the pages structure would be stored in the Database. Within my _Viewstart would be referenced my…
-
3
votes1
answer801
viewsHow to use multiple classes as User in Identity - Asp.Net Identity
I want to use 2 classes as User in Identity and could not see this change in code. Let’s assume that I will use the default class "Applicationuser" that generates an "Aspnetusers" table and I want…
-
3
votes1
answer156
viewsHow to update sql in visual studio 2015
I am in an ASP MVC project. When I try to log in or use the database the following error occurs: The database 'aspnet-Nerdchest-20160621052548' cannot be opened because it is version 852. This…
-
3
votes1
answer785
viewsMount one HTML table from another’s records with Jquery and C#?
I need to compose/generate a new table in html where the records of the new will come from a selection of <input type checkbox> in another table on the same html page displayed in a modal, see…
-
3
votes2
answers2092
viewsFill all fields of an Object iteratively
I have a Class public class Objeto { public int _numero { get; set; } public DateTime _data { get; set; } public string _palavra { get; set; } public decimal _decimal { get; set; } } Is it possible…
-
3
votes1
answer1470
viewsHow to get value from a variable in the controller with ajax(jquery)
I have to take a value from a variable within a method in the controller on . net, the method is in homeController and returns a json, up to there everything well the code is running and returning…
-
3
votes1
answer72
viewsGetting all values on Lambda
My code has the following structure: var a = ViewData["a"]; var b = ViewData["b"]; var c = ViewData["c"]; var d = ViewData["d"]: foreach(var x in ObjetoE).where(x=> x.A == a && x.B == b…
-
3
votes1
answer791
viewsproblem with update Entity Framework 6
This is my method of updating: public dynamic Atualizar(TEntity obj) { dynamic data = null; using (ClassContexto ctx = new ClassContexto(ClassMaster.conexao())) { try { ctx.Entry(obj).State =…
-
3
votes3
answers1947
viewsDropdownlist validation in ASP.Net MVC
I’m having trouble validating my dropdown in a view. In my template I use an Annotation Required as shown in the code below: Model [Required(ErrorMessage="Informe uma cidade")]…
-
3
votes1
answer700
viewsChange table column names created by Asp.Net Identity
My doubt is simple, but I am not able to solve it. It is possible to change the table columns name Aspnetusers that Identity creates in the database? Another question is, how to add new fields in…
-
3
votes1
answer4502
viewsDisplay (decimal) value without rounding
Hello, using a database mysql, with Asp.net mvc c#, have in the database the following value (of decimal type): 48.205864 So when I just make one select, and bring it to the screen, is displayed…
-
3
votes1
answer513
viewsWhat’s the best way to get information to View?
I have the following code: public ActionResult AtualizaCliente(int id) { ViewBag.idFoto = new SelectList(dao.fotos, "idFoto", "Foto"); ViewBag.idInformacao = new SelectList(dao.informacoes,…
-
3
votes1
answer97
viewsUse viewbags for metadata or place them in a Viewmodel
In the scenario below, I own a View that depends on some ViewBags to fill in options in selects html. When performing the POST and if something goes wrong in the registration, the user is redirected…
-
3
votes3
answers7584
viewsCalling the Controller Method
I’m doing a project for the College, and I’m having a hard time understanding how to create a button and call an Actionresult in the Controller, and I was wondering if the action needs to be in the…
-
3
votes2
answers149
viewsHow to resolve error with OWIN?
Well friends, I created an Asp.Net MVC web project No Authentication, but now I’m in need of authentication. I’m following some tutorials like that to put authentication from scratch, but after…
-
3
votes1
answer78
viewsConvert a Session to Boolean - Asp.net mvc?
I have in my system a Session that stores an information "S" or "N" Session["Administrador"] = retorno.ADMINISTRADOR; In the layout I want to convert it to Boolean @{ bool administrador =…
-
3
votes1
answer384
viewsPassing a javascript variable to Session
I wonder, how do I send a value I have in javascript to a @Session. in case it would be more or less like this: I have a variable: var id = $(Person). val(); this ID wanted to use in a session…
-
3
votes1
answer151
viewsMVC Helper with List Energy
I am creating a Helper in my Asp.Net MVC 5 project, and would like to receive as a parameter a generic list, but the following code snippet does not work: @helper MeuHelper(string param1, int…
-
3
votes1
answer800
viewsHow to check if the LINQ expression does not come null
I have this expression LINQ: MaterialImage mainImage = images.First(i => i.IsMainImage == true); My problem is that images. First(i => i.Ismainimage == true) can return null if you have no…
-
3
votes1
answer275
viewsHow to serialize a datetime displaying in the dd-MM-yyyy hh:mm:ss format
How do I send to View() of my Controller in Json format, the default formatted date dd-MM-yyyy hh:mm:ss? In the transport of data between View and Controller I am using AJAX. public ActionResult…
-
3
votes1
answer1199
viewsHow to get filename within folders in WEB API server
I have a directory Archive/Uploads And I would like to list all the files, within this directory I have N folders. what I’ve got so far is here. string path =…
-
3
votes1
answer1102
viewsHow to print text within a @if{ } condition in Asp.Net in cshtml file?
I have the following situation <td> @Html.DisplayFor(modelItem => item.HoraInicial) às @Html.DisplayFor(modelItem => item.HoraFinal) <br /> @Html.DisplayFor(modelItem =>…
-
3
votes3
answers1950
viewsHow to Fix File Upload Error?
I have the following form: @using (Html.BeginForm("importCSV", "Administrador", FormMethod.Post, new { @id = "upldFrm", @enctype = "multipart/form-data" })) { <input id="file" name="file"…
-
3
votes1
answer49
viewsName editing is confirmed in the database but does not happen in the listing
I am editing a column of the database and so far everything goes very well, but when I load the table that contains this column using Include, simply does not update the "Chauffeur", exchange the ID…
c# asp.net-mvc entity-framework linq lambda-expressionsasked 9 years, 5 months ago Luiz Negrini 1,424 -
3
votes1
answer266
viewsCorrect View Creation on MVC using Ajax
I have a page that performs maintaining a budget. Below I present a briefing of entities public partial class Orcamento { public int IdPedidoCompra { get; set; } public int IdCliente { get; set; }…
-
3
votes2
answers2772
viewsPull data from an input when typing in the field
I need a script that when I type a word into a field, it pulls all the data that is related to that word, like a Facebook example, in the search bar, when we type something it already comes bringing…
-
3
votes1
answer447
viewsHow to keep MVC application running on IIS express (in Visual Studio) after debugging?
I’m doing a project on ASP.Net MVC. On the company machine I run the project once (F5), stop the debug and continue accessing the application pages normally. On my personal machine if I stop the…
-
3
votes2
answers705
viewsError while deleting using Entity Framework 6 and custom repository
I am using the Entity framework to do CRUD in the database, but I have an error trying to delete an item: "The Object cannot be Deleted because it was not found in the Objectstatemanager." I’m using…
-
3
votes3
answers1531
viewsValidate field after typing in ASP.NET MVC
I have a registration page in ASP.NET MVC with Entity Framework, this registration has an indication field, where the nickname of the user that indicated. I wanted after typing this field by the…
asp.net-mvc asp.net asp.net-mvc-5 entity-framework-6asked 7 years, 8 months ago Alisson Marqui 1,128 -
3
votes1
answer1099
viewsGet Data from Webservice in C#Action
I have an application that accesses third-party Webservice. To improve the testing process, I am setting up a website to simulate Webservice. This site consists of several Actions, which return XML,…
-
3
votes1
answer226
views5th step using jquery.smartWizard.js
I have the following form menu using jquery.smartWizard.js I need to insert the 5th step and I’m not getting it. How do I insert? Follow below the code of my screen. <!-- Tabs --> <div…
-
3
votes1
answer1373
viewsRedirect to View in another structure
I have a project, which is in an area, in it, my Main controller, has an action that, when called, should return a view that is in another folder, however, within the same area. return…
-
3
votes1
answer755
viewsChanging the status of a field with Javascript
I am developing an application that manages Courses, am beginner in Asp.net MVC. In my application I have a screen that the Pupil makes his Inscription in a course, I also have a field Number of…
-
3
votes1
answer268
viewsMove image to HTML via Viewbag
I have an image in an array of bytes, and I need to insert it in view. Is there any way I can do this through ViewBag?
-
3
votes1
answer351
viewsHow to use inheritance and polymorphism when passing a JSON to a MVC C#Controller?
I have a MVC method that takes a client class as a parameter: public async Task<ActionResult> Cadastrar(cliente model) { } Turns out this class has two kids, a class called a person. and…
-
3
votes3
answers3072
viewsProvide file download from server
There is a feature of registering a customer’s data. The user selects a file from his computer, and this file is imported to the server in a separate folder, and this file can be a PDF, JPEG, PNG.…
-
3
votes1
answer52
viewsViews Index, List views show date in wrong format
I am developing an ASP.Net MVC project and the Views Index and Listing Views show the date in Year/Month/Day format, but I want them to show in Day/Month/Year format. What do I do?
asp.net-mvcasked 7 years, 6 months ago Alerf Morais 121 -
3
votes2
answers80
viewsInserting special character in view
I have an HTML table where one of your td I need to insert the following information: <td>@item.OrderSend º</td> I would like to insert in this way: <td>@item.OrderSendº</td>…
-
3
votes1
answer252
viewsMore performative way to return data to the View
In a view where we return a list of objects, and we need to demonstrate the quantity, as a small report, using some conditions. What is the most performative way to return data to view? Explaining…
-
3
votes1
answer844
viewsC# MVC5 - Table with Checkbox and Different Actions
I am working on a project of which I own a page that lists some records, of which I will 'flirt' some to perform batch actions such as deletion, status change, among others. How do I send this list…
-
3
votes1
answer371
viewsLambda - how to use the operator || (OR) in a . Any()
What would be the correct way to implement the line below, in Lambda? ListaDeRespostasPossiveis.Any(x => x.Nome == "respostaUm" || x.Nome == "respostaDois") I saw some examples in Stack Overflow…
-
3
votes1
answer245
viewsException when generating Controller with Entity Framework
In my application using Asp.net mvc, with Entity Framework 6, with Mysql, when trying to add the Controllers, with Views, using EPH, I have the following error: Settings of my web config.:…
asp.net-mvc asp.net-mvc-5 entity-framework entity-framework-6asked 9 years, 3 months ago Erico Souza 2,188