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
-
4
votes1
answer157
viewsLibrary equal to C# 6.0 runtime Interpolation string
Does anyone know of a library that interpolates at runtime on strings? I know it could be done using Replace(), but I don’t want to pass the list with all the variables. For example: Programa de…
-
4
votes2
answers605
viewsField format for saving time
Which field should I use in SQL Server to save a duration? Ex.: 2days 23H 47min 00Sec. If you have an example with Fluent API it will help a lot.
-
4
votes1
answer114
viewsTime Usage with EF 6
I have a class with the following property. public TimeSpan TempoIdeal { get; set; } Estou atribuindo esta propriedade com TempoIdeal = new TimeSpan(days: 3, hours: 15, minutes:10, seconds: 0);…
-
4
votes1
answer238
viewsHow to do Scaffolding in ASP.Net MVC with text and resources in en-BR?
How to do the texts generated by Scaffolding of ASP.Net MVC to be texts in? Note: It is not using ASP.NET MVC resources en-BR. Resources only translate automatically generated messages, and are not…
-
4
votes1
answer1079
viewsASP.NET MVC permissions system
A long time ago I developed a system, in ASP.NET MVC, where I used the package Mvcsitemapprovider, based on it I made some modifications in Authorizeattribute to perform the verification of user…
-
4
votes2
answers216
viewsView Model should have related classes?
I have three entities: Manager, PersonalData and Address. A Manager has a PersonalData and a PersonalData has a Address. My doubt lies in the time to create the Viewmodels, I would have to have…
-
4
votes2
answers680
viewsDisable css and image caching in the browser
Recently, I developed a project that had some drastic changes in its design, mainly by the side of css and images. In this, accessing it on some machines, I verified that to visualize its new design…
-
4
votes1
answer100
viewsAspnet MVC database first or code first
I have an Aspnet MVC 5 project in which I will use Owin and Identity, I needed to customize Identity (attributes and relations) to meet my needs, but I already have all the tables of the database…
-
4
votes1
answer48
viewsHtml.Editorfor losing value when rebooting the page
am starting my html.editorfor with "0.00" like this: @Html.EditorFor(model => model.Preco, new { htmlAttributes = new { @Value = "0,00"} }) However, when the user receives a validation message…
-
4
votes1
answer90
viewsHow to list products from a single restaurant?
I registered my products in a particular restaurant. Being Restaurant(1) and Products(N), I have several products registered in a restaurant. How do I list these products for each restaurant? This…
-
4
votes2
answers419
viewsWrite access log to ASP NET MVC application
I have an ASP NET MVC site and I need to record it in the database every time someone accesses by recording the client’s IP and access date, is there any way to do this? I don’t want to record every…
-
4
votes2
answers97
viewsHow to bring an item list
I need to bring up a list of ITEMS, with only the Order id. The way I do it is this, but it brings me only one Item, I want to be able to bring all the items I have, with the Order ID. var…
-
4
votes1
answer119
viewsAsp.Net MVC with two views and a URL
I made a website that should work with the following configuration. Navbar on top, that’s okay. Below it I have a container div, it is divided into two parts, the left part is a list of, can be…
asp.net-mvcasked 9 years, 6 months ago Ricardo 5,680 -
4
votes1
answer1630
viewsMonetary values with Asp.net MVC
I am facing difficulty in working with monetary values (decimals) using web application, asp.net MVC, with database Mysql. The problem is I can’t edit decimal values, like: 53.50, or 53.50. I can’t…
-
4
votes1
answer139
viewsHow to make a video file available for viewing in the browser as PDF?
How to make a file available for download and viewing in browser? For example, files of the type pdf and mp4. When I want to make available to download the file I simply use the following routine:…
-
4
votes1
answer1174
viewsRazor C# list and sublist with List<String> (originally "how to check if an HTML element already exists")
I need to know if an HTML element already exists, in my loop, if it exists I use it, if it doesn’t exist I create a. How would you do it inside a @foreach (var item in Model){ ... } Following the…
-
4
votes1
answer643
viewsProblem with Decimal (4,2)
I have an MVC project, I am using Entity Framkework and in my database there is a table with a column of type decimal (4,2). The problem is: I try to insert any value, for example: 5.00 // 5,00 //…
-
4
votes1
answer277
viewsChange property structure at time of JSON serialization
I have a situation where my HTML form represents a different data structure than the existing structure on the server. To illustrate my problem, I will present a hypothetical situation, to present…
asp.net-mvcasked 9 years, 6 months ago Joaquim Magalhães 169 -
4
votes1
answer454
viewsReturn Partialview with validations for a Modal ASP MVC 4
I have an Index screen, where is the table of registered people, on the same screen I have a new button that calls a Modal(boostrap) this way: <a href="@Url.Action("Add", "Pessoa", new { area =…
-
4
votes1
answer119
viewsHow do MVC application authentication with Linux?
I have a project in ASP.Net MVC and I’m putting the authentication manually. Everything is going well, but I used as a reference a ready-made project that uses the Entityframework, but I want to use…
-
4
votes1
answer2448
viewsChanging Routes with Asp.Net MVC
I’m trying to change a route in my project, the control is like this: public class TagController : Controller { // GET: Tag private MYEntities db = new MYEntities (); [Route("tags")]…
-
4
votes1
answer1952
viewsRead CSV file without needing to save it
I have following code: [HttpPost] public ActionResult importCSV(HttpPostedFileBase file) { if (file.ContentLength <= 0) { ViewBag.Message = "Nenhum arquivo foi enviado."; return View("index"); }…
-
4
votes3
answers8500
viewsAngular + ASP.NET MVC: Does it make sense?
I’m starting to study Angular2. As I am working a lot with . NET I decided to do a project with ASP.NET MVC 4 and Angular2. Giving a read on hello world of Angular I noticed that Angular has its own…
c# asp.net-mvc software-architecture angular typescriptasked 7 years, 9 months ago Marllon Nasser 3,845 -
4
votes1
answer955
viewsEdit field within a list in Asp.net MVC
Guys, I’m developing an application that manages Courses, and I’m trying to make a list where present on the screen the Courses, the Student Name and the countryside Approved, where it indicates…
-
4
votes2
answers1180
viewsValidationsummary - Asp.Net MVC problems
I’m having problems with Validationsummary in my application that manages Courses, I have a screen where the student enrolls in a course and in case he tries to enroll in it course again should…
-
4
votes2
answers2052
viewsUpdate page(View) automatically in Asp.Net MVC
Guys, in my application that manages Courses, i have a sign-up screen, where the student clicks on the button "enrollment" and enrolls in the course, and the amount of vacancies field is decreasing.…
-
4
votes2
answers169
viewsHow to capture the Exception generated by a method whose access is not authorized by a particular user profile
How can I send the user a message that the operation he wants to do is not authorized? I have in my View a button that calls a Javascript function <button id="btninicio"…
-
4
votes2
answers118
viewsCan I have more than one Views directory in MVC?
I’m transferring my project to MVC, and I was wondering if there could be more than one folder Views in the project, or if you can load a CSS outside the BundleConfig, have a static page that kind…
-
4
votes1
answer3333
viewsError while consuming Web API
Hello, in an ASP.NET MVC web project I am trying to consume an API that is a Web API project, the two applications are running on the same server. When I access the MVC application error occurs when…
-
4
votes2
answers17227
viewsUnable to load file or Assembly 'Webgrease, Version=1.3.0.0, Culture=neutral
I am just opening a new project based on MVC 5, framework 4.0, c#, and after opening the project for the first time and compiling, error occurs Não foi possível carregar arquivo ou assembly…
-
4
votes1
answer4336
viewsException when it will generate bank bill with Boleto.Net
I have a system that generates Santander billets using a specific DLL that was downloaded from the internet. The name is "Boleto.net". I need to create a Bradesco ticket. I changed where I passed…
-
4
votes1
answer681
viewsHow to check if a file is an image?
I am working on an application using ASP.NET MVC and Angularjs and need to ensure that the file upload will only be image files, even if someone sends an extension of another type of ". jpg" for…
-
4
votes2
answers535
viewsHow to access Action in another Controller via Ajax?
I have an Aspnet MVC project structured as follows: Projeto L Areas L Area1 L Controllers L MeuControllerArea1Controller.cs Views Area2 L Controllers L MeuControllerArea2Controller.cs Views L…
-
4
votes2
answers9830
viewsError encountering file: Roslyn csc.exe
I was using Visual Studio 2017 normally in an MVC project when it asked to update some packages via nuget. By doing this, the application no longer wanted to compile and presents the error below:…
asp.net-mvcasked 7 years, 3 months ago Italo Rodrigo 4,344 -
4
votes2
answers254
viewsCRUD with images , working with Httppostedfilebase and byte[]
We are using Entityframework with Codefirst and Database Postgresql. There are some tables that should save images, and the POCO classes are referenced as byte array. Up to that point all quiet. I…
-
4
votes2
answers1079
viewsEvent loading when conducting queries in AJAX with ASP.NET MVC
I’d like to know how to best place a Waiting to identify that the data of a survey is being processed, in case I have a table and can perform a search filter, when the request is sent I would like…
-
4
votes1
answer5406
viewsWhat’s the difference between cshtml and html
Is there any difference between CSHTML and HTML, mainly in security, performance and application? There is some loss when using HTML on a project ASP MVC, and what are the benefits of using the…
-
4
votes1
answer1724
viewsI have the reference, but when I run the CLR says the reference is missing
I have this include in my project: System.Web.MVC.Ajax. However when running the application I get an error Runtime, in the archive web.config. If I comment on the error line on web.config, error…
-
4
votes2
answers335
viewsHow to receive multiple fields from a view in the controller
I need to create a multi-field Insert at the same time! My system has several tables and relationships and I am struggling at this point. I have this registration screen: With that code: @using…
-
4
votes2
answers812
viewsHow to count columns of an Httppostedfilebase txt file?
In the code below, it would work perfectly if I had access to path of the file uploaded on the client side, however, it doesn’t work that way. So I’d like to ask you guys to suggest another way to…
-
4
votes5
answers1602
viewsChange return /Date(1386295200000)/ to date format
I have a return from json that comes so from SqlServer: /Date(1386295200000)/ How to convert to date format dd/mm/yyyy?
-
4
votes1
answer67
viewsHow to separate a fixed route from a variable route with Asp.net mvc5
I have a control that manages videos. I’m trying to make these two methods: [Route("video/categoria/{categoria}")] public async Task<ActionResult> Index(string categoria) { }…
-
4
votes0
answers187
viewsHow to implement certificate chains? What is the importance/operation?
I created a local application in VS and when climbing the server the application was not with all the resources of the local application, in the application I am using X.509 and found a difference…
-
4
votes2
answers119
viewsBest way to give Binding on objects from 1 to N - Asp.net MVC
I would like to know how best to give the Binding of data in the object FuncaoGrupo of my Controller. Each item in the list Funcoes will generate 4 Checkbox in View. I have the following class:…
-
4
votes1
answer144
viewsSeveral Books for Author
Recently I asked a question about my problem, but it got a little hard to understand, here I will try to summarize my problem. I’m using ASP.NET MVC. I have 2 tables: Autores and Livros, where 1…
-
4
votes1
answer1918
viewsWEBAPI AND A3 CERTIFICATE - TOKEN
Can anyone here use A3 type certificate for a WEBAPI ? Because when I test it in debug (i.e., local), everything works normal. But if I compile, and put in the IIS application, keeps returning me…
-
4
votes1
answer392
viewsWhat is the advantage of using Tag Helpers in ASP.NET Core?
I am studying the ASP.NET Core and came across the tag helpers when I ran the scaffold of a view. I found interesting the new syntax, the code is more readable at some points, however, the inclusion…
-
4
votes1
answer1197
viewsHow to send Angularjs data to an ASP.NET MVC backend?
What would be the best and simplest alternative? I have the Web Api: using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Net.Http; using…
-
4
votes1
answer480
viewsUser registration and password
I have an acceptance problem. After configuring Microsoft.AspNet.WebPages.WebData and the corresponding classes, the system correctly created the tables in the database so that I could implement the…
-
4
votes2
answers424
viewsMutiplos projects in MVC and Webapi
I’m looking for if there are any project models that involve multiple MVC and Webapi projects. In the solution I’m thinking about designing (if possible) a content management solution for multiple…