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
-
2
votes1
answer344
viewsMVC Hidden Field Encryption - How to decrypt more than one Server-side property
Hello I’m developing a web application mvc 5 and in some cases I need to insert in the view fields @Html.Hiddenfor, only I don’t want to show the value to the user if he views the html code, So far…
-
2
votes1
answer3973
viewsIIS 7 - Error 403 Prohibited: access denied
I have a webservice restfull and when Pure on my machine with my Visual Studio it works normally, but when I publish on my production server with IIS 7 it gives a denied access error. My project is…
-
2
votes1
answer97
viewsHow do I not lose the data included in Claims in the revalidations of Cookies?
I have an application that needs to control the access of users who are according to the profile of each one. Empresa, Filial. In the User entity I added the fields referring to these other two…
-
2
votes3
answers97
viewsGroup repeated values of Dropdownlist fill sql statement
I’m taking information from a table and filling out a DropDownList, but I have a lot of information repeated and I would like to group the values so that they are not repeated in the DropDownList.…
-
2
votes1
answer194
viewsModal pagination using Url.Action
I have a modal of products, in the controller page has a get function to complete it when opening, and a post for filters and pagination. My problem is that paging is done by Url.Action("Index", new…
-
2
votes1
answer351
viewsPass data-id="@Milestones.Code" to a modal
My system should work as follows: By clicking the button highlighted in red in the image below He opens this modal here: This already happens, but now I need to click on the first image, it takes…
-
2
votes3
answers40
viewsSystem.Nullreferenceexception in an attribute of type Stringbuilder
Why error occurs? How to fix? Model: public class modelExemplo { public StringBuilder listNewsletter { get; set; } } Controller: public ActionResult funcaodeteste() { modelExemplo obj = new…
-
2
votes1
answer89
viewsIn a MVC 4 C# Web Application model, in which layer can the ADO.NET Entity Data Model file be located?
What layer do I put him in? Model control or view? ADO.NET Entity Data Model what makes the connection to the database.
-
2
votes2
answers108
viewsProject Empty Mvc. I can’t startar
I started doing a project from scratch using MVC 4 from VS 2012. As I opted for an Empty, I can’t get the view started. I took the route: routes.MapRoute( name: "Operador", url:…
-
2
votes1
answer78
viewsSelecting Suppliers by Fancy Name
I have a PRODUCT registration form and there is a relationship with the SUPPLIER table, as shown in the image below: Which click on the SEARCH VENDOR button will appear this View Now I need to…
-
2
votes3
answers2741
viewsSend Javascript Array to Controller via POST
I’m trying to send a Array of int of JavaScript to the Controller via POST. See my array: console.debug(itens); Array [ 1, 2 ] I’m trying to send it this way: $.post('@Url.Action("MinhaAction",…
-
2
votes1
answer1603
viewsError while listing Data via Json
I’m wearing a method to return an object of the type JSON but is not listing the information: Man Controller public ActionResult GetDados() { int codigoVenda = 2; try { SistemaDBEntities db = new…
-
2
votes2
answers155
viewsConvert date 20171130 to format 30/11/2017 in string
I have this date field '20171130' saved in the database, and I need to convert to string formatting "30/11/2017" in my application, how to do this type of conversion ?.
-
2
votes1
answer38
viewsVisual Studio Error 2015 Update 3 cannot remove breakpoint
In my project I have a solid breakpoint in Visual Studio that I can’t remove. I can add other breakpoints. Some removed, but some not. Does anyone know how to fix this?…
-
2
votes1
answer831
viewsReturn view that is in another directory
I added a folder inside another folder in the views folder, this way: Views/Register/Profile Inside the profile folder are the files .cshtml. However, when I try to access the files .cshtml I get an…
asp.net-mvcasked 9 years, 1 month ago Deivid Farias 460 -
2
votes1
answer362
viewsHow Does Life Cycle Dependency Injection Work?
How the 3 life cycles of a dependency injection works such as Singleton, Transient and Scope ?
-
2
votes1
answer324
viewsParameters between pages (ASP.NET Core / C#)
Hello, I have a question in which I already researched a lot and did not get any concrete answer. I am beginner in C# and ASP.NET, forgive me for ignorance. I have a project in ASP.NET Core MVC. On…
-
2
votes1
answer189
viewsHow can I make a MVC lambda filter
I’m making a simple filter, and show the data on the page. The code I’m using is this: mt.ModelItens = db.Forecast .Where(f => (f.CanalForecast.area == idArea && f.CanalForecast.despesa…
-
2
votes1
answer1007
viewsHow to implement PKCS#7 (components->class, library, dll, plugins and others) in a MVC5 web application
I’m trying to implement PKCS#7 in an application web mvc5 found some solutions for application desktop, never added desktop(class,dll,Ference etc) solutions to a web application, maybe it’s the…
-
2
votes1
answer707
viewsVisual Studio Error - Cannot find name 'Record'
I am working on an ASP.NET project with c# in Visual Studio 2015 and I came across an error in the file index.d.ts. The error messages are Cannot find name 'Record' and Cannot find name…
-
2
votes2
answers909
viewsGenerate HTML elements via Javascript
I need to create a code that after passing some parameters it generates a graph similar to the image below, I thought of creating a table for each activity. Does anyone have any tips, or do you know…
-
2
votes1
answer314
viewsView call @model of the controller
I use the EF Design and import all my models from the bank to a .EDMX. I ask you: How do I call the objects of controllers that I create, within a View? I’ve tried to put @model up to the controller…
-
2
votes1
answer4221
viewsAsp.net web api From Ri and From Body when to use?
Asp.net web api that serves [Frombody] and [Fromuri] and when there is real need to use ? example: public IHttpActionResult Get([FromUri] email) { } public IHttpActionResult Get([FromBody] email) {…
-
2
votes1
answer108
viewsRequired validating property of another object
I have the following properties, however when I will validate via Modelstate.Isvalid returns that the description of the user group to be informed that it is User too, but the problem is that I am…
-
2
votes1
answer106
viewsEnsure that Httpconfiguration.Ensureinitialized()
Goodnight! I’m studying about ASP.NET (I come from java) and I’m a little confused by all this. I am trying to create an endpoint to return the client list of my database, however, I can not in any…
-
2
votes1
answer108
viewsUpload videos Datatype Asp.Net MVC
I want to put a Video Upload field on my Asp.Net MVC system and I did not find anything related to videos on Datatype. I found various datatype such as [DataType(DataType.ImageUrl)]…
-
2
votes1
answer1235
viewshow to select Count using Linq C#
I need to convert this chunk of SQL code to Linq C#. I’ve been able to convert virtually every code. SELECT COUNT(Q.ID_QUALIFICACAO) AS CONHEC_ESPECIFICO FROM QUALIFICACAO Q INNER JOIN ATENDIMENTO A…
-
2
votes1
answer965
viewsHow to upload a file at the same time as sending an Asp.net mvc 5 form
I already have a form that makes a registration, I want to add an extra field in it where the user will upload a photo, I want to do everything in the same Ubmit. My VM Vmdominiocreate: public class…
-
2
votes1
answer44
viewsHow to add a span to an htmlhelper?
I have this helper <li>@Html.ActionLink("Registar", "Register", "Account", routeValues: null, htmlAttributes: new { id = "registerLink"})</li> I wanted to add this <span…
-
2
votes0
answers65
viewsPut web application online (publish) done in visual studio?
I developed a website on Asp.net C# in the Visual Studio 2013 for a company. This company wants to replace its current website with the one I developed. This site is located on the server of a…
-
2
votes1
answer465
viewsHow to play a stream streaming mms on ASP NET?
I use the Microsoft Encoder to transmit a video via protocol MMS. The video is streamed by streaming. It is the footage of an event being streamed synchronously to the network (for the time being…
-
2
votes1
answer346
viewsProblems generating a Partialview with Begincollectionitem
With the intention of creating an action for Adc/Delete data dynamically to a table with relation 1 to Many, the . net returns the exception "Undefined object reference for an object instance." when…
-
2
votes0
answers964
viewsWatermark (Watermark) on ASP.NET MVC PDF rotary
Hello, I’m having trouble adding a watermark in a report generated with rotary pdf. This report has a header, which repeats on all pages and a footer that also repeats on all pages, now I want to…
-
2
votes1
answer59
viewsSearch form does not execute controller method
I have the following form: <form role="search" method="get" id="search-form" name="search-form" action="/video/pesquisa"> <div class="cover-pursuit-btn"> <button type="submit"…
-
2
votes1
answer153
viewsIf inside the button
I have this "Receive" button, and this checkbox that when it is marked, means that the account is paid: I need that when he clicks the Receive button, and the checkbox is already checked, that he…
-
2
votes1
answer282
viewsCreating ASP.NET Core File Folder
Hello I am generating a file folder via code, but it n appears as if in fact it is inside the project/solution, like this: I would like to create (via code) the file folder so that it is actually…
-
2
votes0
answers44
viewsThe entire data inside the dropdown loads in the get request and not in the post
I made an Edit function that works with 3 different models, get loads the id data I selected, but at post time, the integers within the dropdowns comes with attribute 0. Follow my code for…
-
2
votes1
answer88
viewsHow to handle multiple parameters not required on a route
I have the following wheel on an Asp.net mvc control: [Route("video/categoria/{categoria}/{page?}/{sort?}")] The three parameters are: categoria, filters the video category, page? is the pagination…
-
2
votes1
answer620
viewsC# MVC Routebase routing Too Many Redirects
I have an all dynamic system where I get all my paths, controllers, views and areas from the BD. My problem now is when I try to access a page it returns to me too many redirects response. What…
-
2
votes2
answers104
viewsError saving a Many-To-Many relation
Following the models that of that question, I am having problems trying to save the data (keys of each of the records) in the table created to make the data relationship. Follows the post method I…
-
2
votes1
answer92
viewsHow to insert information from a model that has a Relationship?
I have a listing of Products and this listing has the supplier code, I need to enter the name of the supplier in this listing. My Controller: public ActionResult Index() { IEnumerable<Produto>…
-
2
votes1
answer164
viewsASP . NET MVC Project Archives do not open "the Operation could not be completed"
I try to open "cshtml" files and it does not open, presenting the error below. This occurs in all my projects, started from one hour to the next. I use Visual Studio 2015, project ASP . NET 4.6 MVC…
-
2
votes2
answers399
viewsUse Viewbag as counter
Is there any way I can use the ViewBag as an accountant? WHAT I NEED? I’m making phone registrations. When I add a new phone, I send my View for my Controller and he returns me to PartialView of my…
-
2
votes2
answers219
viewsRelative path to txt in ASP
Good afternoon, I am generating a file with Asp net the function saved in the hard drive if I put the path, however this file will be saved in a server and I’m having difficulty to put the relative…
-
2
votes1
answer61
viewsWhat is the correct way to legitimize a particular user through Identity with Soap web service?
Initially I tried to add snippets that are related to Identity and I used the Find method with password and login, but I was not successful. using System; using System.Collections.Generic; using…
-
2
votes1
answer65
viewsModify Httpcontext.Current.User is breaking the Bundle Optimization
I did several tests and I could see that by modifying the HttpContext.Current.User Application_PostAuthenticateRequest (Global.asax.Cs) I get an Internal Server Error in the concatenated/minified…
-
2
votes1
answer425
viewsIs it possible to validate the import of an excel file with regular Expression?
I am importing an excel file using Asp.net and validate to see if it is really an excel or not. I don’t want to use if and else, so I’m trying to do this through Annotations. My main idea now is to…
-
2
votes2
answers46
viewsID is null when I enter the details by index
When I enter the registration details by the ID index it is always null. http://localhost:17542/Availability/Details/0 Controller Details: public ActionResult Detalhes(int? id) { var disponibilidade…
-
2
votes2
answers316
viewsJSON function Does not return value
I have a problem, I would like to popular my Dropdownlistfor with the result of another Dropdownlistfor, for this I am using Ajax and Json, same concept they do when they want the result of State to…
-
2
votes2
answers293
viewsUsing Linq to sql, how do I get the generated sql query?
Hello. If I have an example: var agendamento = _repository.First(a => a.iid == id && a.locIid == _usuario.LocalidadeContextoId && a.activeVersion == 0, "", true); I can see the…