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
answers1328
viewsHow to make a user helper logged in to Asp.NET MVC 4?
I need to implement a Helper for logged in user, ie a static class that returns information about the logged in user from context. The idea is to use the information both in Controllers how much in…
-
3
votes3
answers9298
viewsReturn the previous page with the back button
I have a back button that is supposed to return to the previous page, regardless of which page is on the system. How can I do this using MVC 4? The returnURL has something to do with this feature?…
-
3
votes2
answers2101
viewsHow to decode an image in Base64
I’m trying to decode an image, the string that comes as a parameter in the Image attribute of the post object looks like this: "data:image/png;Base64," and a lot of letters, numbers, and symbols on…
-
3
votes2
answers340
viewsIs it bad practice to use foreach inside the View?
It’s a bad practice to use foreach within the View? If it is, how to do it?
-
3
votes1
answer7349
viewsHow to access the application from another computer running on localhost
I have a web application made in ASP.NET MVC 5, and gave a start in Visual Studio 2013, the address of the Index page was like this on the machine where it is running: http://localhost:51144/. How…
-
3
votes1
answer3372
viewsHow to make a complex SQL query in . NET MVC
I would like to know how to make a query, using multiple fields, multiple tables with Inner joins in ASP.NET MVC without having to put the SQL string in the code, using the Entity Framework. At the…
-
3
votes1
answer469
viewsProblem with Custom Routes and Httphandler in ASP.NET MVC
On a project I’m working on, I wrote a HttpHandler to bring as a response an image instead of a View, sort of like this: using System; using System.Web; using System.Web.Routing; using…
-
3
votes1
answer104
viewsDisfigured ASP.NET routes
From trying and searching I think I’ve disfigured something important, so I can’t make the routes work. In this image it appears that the form is being posted to the Loginprofessional controller in…
-
3
votes1
answer895
viewsEdit data from a combo box
I’m having a problem with my Asp.net mvc application. What’s going on is that when it comes to saving the data, my combo boxes carry data from enums. These combo boxes are from an application to a…
-
3
votes2
answers728
viewsSimultaneous client side and server side requests
When using Ajax, I create an asynchronous request for my server. If I use N ajax requests simultaneously, I’m still handling these requests synchronously on the server? If yes, to create an…
-
3
votes2
answers673
viewsCheckboxlistfor with error
Description: Error when compiling a resource needed to fulfill this request. Examine the error-specific details and modify the source code appropriately. Compiler Error Message: CS1061:…
-
3
votes2
answers136
viewsDevexpress spin - Culture info
I’m using the devexpress spinedit, with MVC, it’s a decimal field, but I need the number score to be a point and not a comma, I need to put its culture as "en-US", how to do?
-
3
votes2
answers2764
viewsIF condition inside _Layout.cshtml in MVC
I have two _Shared.cshtml (MVC masterpage type, do not know the name) and both are virtually equal, only the menu left is different. I would like to do only 1 and according to the querystring I will…
-
3
votes1
answer1261
viewsMap associative tables in the Entity
This has already happened. When I use an associative table in Entity, these tables usually don’t have PK. When this happens, I can’t map them. How can I map this type of table?
-
3
votes1
answer144
viewsBest practice action result targeting
I need to direct the administrator to a location, the first-time student to another and the student who has already accessed, to another. My validations are working, everything is going well.…
-
3
votes1
answer419
viewsDoubt about static methods and classes
I have a question about methods and static classes, given the code below: static List<MaterialRCM> mr = new List<MaterialRCM>(); [Authorize] public void AddMaterial(int Qtd, int Id) {…
-
3
votes1
answer1208
viewsWork unit (Unit of Work) with repository
In ASP.NET MVC & Entity Framework, because many examples and some open-source projects find a unit of work together with the repository pattern whereas the DbContext is already a Unit of work,…
-
3
votes1
answer1187
viewsGet Login User Id
How do I get the logged in user id on the site, then insert it into another table? Trying to explain better. I have an action called Criapub, which allows the user to write their publications on the…
asp.net-mvcasked 10 years, 1 month ago Ryan Santos 515 -
3
votes2
answers217
viewsProblems with date format
I am developing a system using C# MVC and Jquery UI and at the moment I am having problems with date formats, in inputs is the date in the correct format "dd/mm/yyyy" but the server is receiving the…
-
3
votes3
answers936
viewsHTML Helpers in ASP.NET MVC 4
I saw some HTML Helpers like this: @Html.LabelFor(x => x) and @Html.LabelFor(model => model.Propriedade), however, I do not understand this parameter that I must pass, x => x, what is this?…
-
3
votes2
answers782
viewsJavascript and Asp.net mvc help
In my project I have a field that is the Status of a certain occurrence. That is, if it is pending or solved. I made a javascript function that , by clicking the input field that is in readonly…
-
3
votes1
answer40
viewsWrong webservice message integrating with Actionscript
I’m making an application restful in C#, where I will receive a request via post and return a JSON or a string to the applicant. [HttpPost] public string confirmahora() { String OUTPUT = "mensagem";…
-
3
votes1
answer159
views(ASP NET MVC4 or 5) How to pass a custom name to Xmlhttprequest?
Guys the question is this, I have a <input type="file" id="fileupload"/> and a field <input type="text id="Nome"/>. To pass it to my controller, I do the following: var data =…
-
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
votes2
answers2093
viewsSend file from one server to another
The application is on an X server. From a precise upload file the file is sent to a Y server. However, I can’t find any solution for this. The application is in MVC Asp net. To upload the file to…
-
3
votes2
answers865
viewsASP.NET vNext in Apache
I have heard a lot that ASP.NET 5 will work not only on Windows environment but also on Mac and Linux. I was wondering if you can run ASP.NET 5 applications on the Apache server. I searched a little…
-
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
answer375
viewsTranslation of MVC routes
With the ASP.Net MVC 4 I am wanting to translate all my routes, currently some are like this: http://localhost/pt-br http://localhost/pt-br/sobre http://localhost/pt-br/usuario/cadastro I am adding…
-
3
votes2
answers1365
viewsASP NET MVC5 - How to enable and disable HTML elements
The program has in the session some customer data, as CPF and Full address (including state where you live). If the customer is from São Paulo, enable a specific combo, if it is from another state,…
-
3
votes2
answers486
viewsAsp.net mvc Bad Request
When using the class HttpStatusCodeResult as a return to a Action, how do I redirect the user to a custom page according to the error?
-
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
votes1
answer4362
viewsQuery to the C# mvc database
How is the syntax or how do I transform a query with multiple joins to a search in my application in c#Asp.net mvc? Example: I have a form with the following controller public ActionResult…
-
3
votes2
answers569
viewsRelationships in Viewmodel with EF
I am developing a project where a user will have several data. To not extend the class I thought to separate by categories. Example of classes: User Data Dadosfamily Etc.. To do this on the site I…
-
3
votes3
answers1145
viewsAsp.net MVC Session ends
I have an app ASP.NET MVC 4.0 on a server of Kinghost. In my web.config I’ll tell you what: <sessionState timeout="1000"></sessionState> <authentication mode="Forms"> <forms…
-
3
votes1
answer1120
viewsModal de Confirmação
I need to create a modal with a warning for the user when they click the save button. I already have a similar one that is used for when the user clicks on 'Delete' that is in my view /Delete <h4…
-
3
votes1
answer485
viewsUpload system with rotate image automatically as in windows 8.1 or facebook
Today when viewing an image in windows 8.1 even if the image is lying down it automatically understands and shows correctly, in windows 7 appears the picture lying down. When sending this image to…
-
3
votes4
answers3610
viewsReceive an array in the controller from javascript
I am creating an array with a javascript data list: var myArray = gvSortingListagemGARs.keys; Where I have the result: [278, 279, 280, 281, 282] Who are id's of elements of a Devexpress table. Now…
-
3
votes2
answers201
viewsHow do I return an existing item in my enumerable via Contains?
I have an enumerable, and I intend to query through a code per parameter. if the enumerable "Contains" Code, then it will return to me all items that are with this Code. See I was trying to do it…
-
3
votes3
answers606
viewsCorrect Inheritance in Entity Framework
I have a mother class DadosClientes and two child classes DadosClientesPF, and DadosClientesPJ. Instance DadosCliente has the field: Nome, Telefone Instance DadosClientePF has the field: CPF…
-
3
votes4
answers1604
viewsAccess javascript variable in template loop
I am creating an Asp.Net MVC project and found a problem in View. See the code: <script> var data = []; for (var i = 0; i < '@(Model.Count())'; i++) { data[i] = { "source":…
-
3
votes2
answers190
viewsCode abstraction
I am creating a project of questions and answers, more to consolidate my knowledge and acquire others. But when developing it I arrived at a question that I am thinking about which of the options…
-
3
votes1
answer727
viewsLearn Asp.net without dominating c#?
basic doubt. I want to start programming for the web with Asp.net mvc, but I know very, very little c#, just the basics of the language. Would it be a bad deal to start with Asp.net and get the…
-
3
votes1
answer106
viewsHow to make a MVC 6 application available (Aspnet 5)
I worked with Asp.net for a while and I don’t have much knowledge on the infrastructure part, I always published my apps by visual studio and then on the server, I added a new application by IIS,…
asp.net-mvcasked 9 years, 6 months ago Kevin 470 -
3
votes3
answers1909
viewsTry/catch does not show correct message
Guys, I have a C# code that has the code: Uri resultadoURL; bool resultado = Uri.TryCreate(Configuracoes.Configuracao.URL, UriKind.Absolute, out resultadoURL) && resultadoURL.Scheme ==…
-
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
votes2
answers393
viewsLoad Only part of the Site by clicking Actionlink
I own the following ActionLink in my MasterPage. <div class="areaRetangulo"> <div class="col-lg-3 vermelho retanguloTamanho primeiraImagem"> <div class="triangulo…
-
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
votes0
answers83
viewsQuestions about Forms Authentication ASP.NET
I have an ASP.NET project and need to enter a user control to limit access to the pages. There is already a table in my bank with Login and Password, I found some tutorials that explain how to use…
-
3
votes1
answer367
viewsHow to make Footer stay in the footer after using AJAX?
I have done several applications and always used the method below to regulate the height of footer. Always using Bootstrap. HTML <div id="footer"> <div class="navbar…
-
3
votes1
answer331
viewsAdd Textbox inside an HTML table with Jquery
I have the Jquery Script below that searches a Material and returns a Json list of that materials, I need to put this data in a table and put a field for the user to enter the amount of these…