Most voted "asp.net-mvc-5" questions
This tag should be used when the question refers to some features only available in version 5 (currently the latest) of ASP.Net MVC. ASP.NET MVC is an open-source Microsoft framework that implements the Model View Controller architecture standards for web development. Based on ASP.Net, allows software developers to build web applications following the Model View Controller architecture standards.
Learn more…937 questions
Sort by count of
-
3
votes1
answer411
viewsHow to get the specific type of error returned by the Entityframework?
Following the question: How to intercept exceptions when working with the Entity Framework? Is it possible to get any error type identifier? For example, Primary Key Violation, Foreign Key…
-
3
votes1
answer589
viewsApplication Layers and Web API 2
I have a question in the planning and structuring of my application and hope to hear the most experienced. Today, in the plan, I have access to data (DAL) and the MVC 5 Web application in different…
-
3
votes1
answer121
views"untrusted Domain" error when trying to connect to the database
While trying to connect to database, I get the following error: Login failed. The login is from an untrusted Domain and cannot be used with Windows Authentication. I’m using MVC 5 and below follows…
-
3
votes1
answer524
viewsError sending file via Postasjsonasync method in Asp.Net MVC
In my Controller of a project Asp.net MVC I get from View a picture like HttpPostedFileBase and need to send to Web Api using PostAsJsonAsync: var response = await…
-
3
votes3
answers500
viewsSecurity key in Asp.net mvc
I wonder if there is any way to generate a security key that is attached to the name of the computer on which the application is hosted. What is this for? So that if by chance a malicious person…
-
3
votes3
answers12809
viewsError while running my MVC application
That is the mistake: Linha 1: <%@ Application Codebehind="Global.asax.cs" Inherits="Util.MvcApplication" Language="C#" %> I had created another project called Util and started to give this…
-
3
votes1
answer328
viewsReturn Join Linq C#
I’m trying to return a Join to my class and it’s giving me the following error Error 1 Cannot implicitly convert type System.Collections.Generic.List in 'System.Collections.Generic.List' C:…
-
3
votes2
answers379
viewsJson format on return
I need to pass a json with the following format: {rows:[ { data:[ "1", "Nome teste", "Descricao teste"] }]} But when using my jsonresult action, I don’t know how to return this way public JsonResult…
asp.net-mvc-5asked 10 years, 3 months ago Rod 9,412 -
3
votes1
answer237
viewsVallidationsummary shows no error on screen
I am using Validationsummary in Forms, but these are not being rendered. Is there any known reason for this error? Form example: @using (Html.BeginForm("CadastrarPessoaFisica", "Usuario",…
-
3
votes1
answer33
viewsWhat mistake is that?
I am trying to change the css of my application in Asp.net mvc 5, but when trying to do this returned me this error ai. Does anyone know why?…
-
3
votes1
answer1420
viewsJquery validate does not validate correctly
I am using Jquery validate and unobtrusive for validation in an Asp.net mvc 5 project When I needed to work with decimal numbers, in search I found this Link where it has the validations and etc.…
-
3
votes1
answer68
viewsHow to save Dysicpline?
I have the following problem with my application. The course table is related to the Discipline table, that is, 1 Discipline belongs to several courses, and at the time of registering a course and…
-
3
votes1
answer238
viewsPerformance in string filter queries vs foreign key
I’m working on a project Asp.Net MVC 5 using code first and all entities have a property called UserId of the kind string. When I will make queries filtering by a certain user(Asp.Net Identity) I do…
-
3
votes1
answer158
viewsMultitenancy with Entity Framework
I have my application, which shares the same database with all my customers. Separating them only by a column of the table Empresa_Id, all my actions, Save, List, Edit, Delete are done by my…
-
3
votes1
answer1543
viewsCorrect use of async and await in Asp.Net
I am creating an asynchronous method for sending Emails from the opening or changing of the object, but when calling the method of sending email I have to put the await in front and the return of…
-
3
votes1
answer49
viewsPrealoder when requesting dowload
I’m making a return of a pdf from a Custom ActionResult response.ContentType = "application/pdf"; response.AddHeader("Content-Disposition", "attachment; filename=teste.pdf"); And I wonder how I…
-
3
votes2
answers1052
viewsPass data encrypted by URL in ASP.NET MVC
I need to pass a link, but I didn’t want to leave it too exposed, I would like to know how to encrypt at least the object id. I created a class for Cryptography, only it generates "/" and this puts…
-
3
votes2
answers478
viewsHybrid Web Application (MVC and Web API)
In Visual Studio when we create a web project it gives you the options to mark: Webforms MVC Web API When MVC + Web API frame the two are in the same project. There is some advantage/performance in…
-
3
votes1
answer102
viewsOndisconnected event in Signair does not work right
Guys, I’ve developed a chat accordingly with this link and it all worked out well. But the Disconnected event doesn’t work right. What happens is that, according to the reference link, this event is…
-
3
votes1
answer3595
viewsUsing Jquery Datatables with ASP.NET MVC 5
I have doubts how to use Datatables with MVC 5 and with Submit button returning a Json as per the site: Datatables $(document).ready(function() { $('#example').dataTable( { "processing": true,…
-
3
votes1
answer96
viewsAsp net mvc 5 resize image
I am in need of a help to resize the image I received by uploading the user, you have any suggestions? Model: public HttpPostedFileBase TypeImageFile1 { get; set; } View: <div class="fileUpload…
asp.net-mvc-5asked 9 years ago user1631012 51 -
3
votes1
answer1209
viewsHow do I use @Html.Actionlink to create links to a multi-trace route?
I’d like to use @Html.Actionlink to create the following link: http://localhost:59278/video/categoria/new-movies/3 Being that my control is: [Route("video/categoria/new-movies/{page?}")] public…
-
3
votes1
answer1001
viewsHow to register legal and physical persons in c# mvc?
How I do in Personal Action Create? Personal: [HttpPost] [ValidateAntiForgeryToken] public ActionResult Create([Bind(Include =…
-
3
votes1
answer1734
viewsHow to return dynamic list?
How to return a List<dynamic> in ASP.NET MVC 5 and Entityframework 6 For example I have an object with name User and mapped in my EDMX, when I do to bring the data dynamically like make an…
-
3
votes1
answer45
viewsHow to "escape" the @ in Razor
I am trying to leave @ as string. Here is the code: hint: { mentions: ['Pedro', 'Tiago', 'João', 'Maria'], match: /\B@(\w*)$/, // Problema com @ search: function (keyword, callback) {…
-
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
answer563
viewsWhat is the difference between [Acceptverbs(Httpverbs.Get)] and [Httpget]?
What good is HttpGet and what’s the point AcceptVerbs(HttpVerbs.Get) ? Example: [AcceptVerbs(HttpVerbs.Get)] public ActionResult GetStatesByCountryId(string countryId) { return .... } Other Example:…
asp.net-mvc-5asked 7 years, 11 months ago Matheus Miranda 5,375 -
3
votes2
answers5090
viewsError localhost Visual Studio
My VS was working perfectly, today I bought and installed the antivirus Kaspersky, when I went to run a site ASP.NET (MVC) the following error appeared: UNABLE TO START PROGRAM 'An operation is not…
asp.net asp.net-mvc-5 visual-studio entity-framework-6 localhostasked 7 years, 9 months ago Jefferson Souza 379 -
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
votes2
answers70
viewsHow to use Contains without capitalization and minuscule
Follows the code: var result= db.Table.Where(l => l.Field== value).ToList(); var search = "jOãO pAuLo"; result = result.Where(l => l.Example.Contains(search)).ToList(); Only works that way:…
-
3
votes1
answer265
viewsCompare TXT with Table in database
I have a TXT file generated by SISOBI, where it contains a list of people who died. This txt is generated, and I need to read the file and compare the CPF, which is the only key present in the file,…
asp.net-mvc-5asked 9 years, 8 months ago Randrade 21,612 -
3
votes2
answers1031
viewsNull object on Deserializar Json
I request an API, which returns data in the form of JSON. Example: { "id": 8452, "creator_user_id": { "id": 46342, "name": "ADM. Suporte Comercial", "email": "*******@gmail.com", "has_pic": true,…
-
3
votes1
answer325
viewsWhere to place asynchronous request methods following ASP.NET MVC standards?
I always put in the View Controller, is the right way to do it? I doubted it because I realized that I am filling my view with asynchronous methods, and I would like to leave it all separate so that…
-
3
votes1
answer98
viewsHow to convert a view to string in the controller?
I’d like to convert that view for string and have the value in string in my controller The problem is that I’d like her to perform a snippet of script that’s in this view The current method I have,…
-
3
votes1
answer613
viewsHow to start on MVC5 ASP.NET?
Hello! About a month ago I started to venture around the world of C# and then I started to study Framework .Net. Soon after I started to study ASP.NET due to the need in my company. Today I use…
-
3
votes2
answers298
viewsConvert Linq query to Dapper
In my application I have the following query: public IEnumerable<Cliente> BuscarClientePorAnoETipo(string ano, string filial, string tipoPrestacao) { var filialConvertInt =…
-
3
votes1
answer316
viewsHow to automatically minify CSS/Javascript in ASP.NET MVC5
I use Visual studio 2017, my application runs on ASP.NET MVC5 (Razor), there is a way to minify all the files I choose at the time of "Publish" ?
-
3
votes2
answers89
viewsTransforming bank information into Link
I’m making a site with a string from the database but I want this string to be informed as follows, in place of it will appear a button that the user will click and this button will open the url…
-
3
votes1
answer501
viewsFill in date and time in View mvc 5 Razor
I have a registration form where I have a record date field that I currently fill in my save method, only that my server is hosted in another country where the field is being filled in from the…
javascript c# entity-framework asp.net-mvc-5 asp.net-web-apiasked 5 years, 11 months ago Thiago Ubiratan 353 -
3
votes1
answer512
viewsError: Cannot convert Implicitly
I’m getting the following error. It is not possible to implicitly convert "System.Linch.Iqueryable" to "Testemercos.Models.Applicationproduct". There is an explicit conversion ? in that part of the…
-
3
votes2
answers400
viewsC# MVC5 - Insert Fields with 4 Decimal Digits
I am making an entry in the database (SQL Server 2008) of a field configured to 'decimal(10,4)', from which I try to insert/edit, by my application C# MVC5, a field of my model of type 'decimal''.…
-
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
answer308
viewsHow to use Html.Beginform with Javascript/Ajax
I have a View to generate Report on my system and I am using a Beginform. The idea is when I give the Ubmit to my Gridrelatorium, which is another View, press inside one that I have inside in the…
-
3
votes1
answer415
viewsModal bootstrap MVC 5
I’m trying to use the modal of Bootstrap, but I can’t make the window open in modal form with the style of the page, instead it opens as a page with no style and using the whole browser frame.…
-
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
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 -
3
votes1
answer2091
viewsMake a button to add properties to a list using Begincollectionitem C#
I have a register of people and need to create a button to add multiple phones and send to my controller, I am using Begincollectionitem, based on my other question Form using Begincollectionitem…
-
3
votes1
answer211
viewsWhen mapping class to viewModel, some data is lost
I have an appointment that returns a client and his phone, but when mapping the class to the viewModel, I lose phone data: consultation: public Cliente ObterClientePorId(Guid ClienteId) { var…
-
3
votes1
answer455
viewsConsult in several fields of the record in a single query
I am developing an item list filter, and would like to filter by any term of the item record. I’ve seen this work in Angular, but I’m developing for ASP.NET MVC 5 and using the Entity Framework +…