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
answer404
viewsProblem with Entity Framework Relationship
I am having problems in the relationship of my bank, I am developing an application that manages Courses, I am still beginner in Asp.net MVC. I have two tables Pupil and Course, and I have another…
-
2
votes1
answer1098
viewsHow to configure Web Api route to accept named parameter(query string)?
I have a web api with the following method: [HttpGet] [Route("api/documento/doc/list?{cpf}")] public string Listar(string cpf) { return "value"; } I need the above method to be called through the…
-
2
votes1
answer120
viewsHow to know the View() call link. NET MVC
I have a controller with a view at the end to show details of a company. I am making a code that allows generating a url to the company details through the goo.Gl to be easier and enjoyable to…
-
2
votes2
answers547
viewsParse with quotation marks in the middle
I have in the database a column of the type varchar that takes a JSON. That column is the description of a company, but in 4 languages. The logic I have is the following: { "PT":"Descrição com…
-
2
votes1
answer167
viewsSignalr loses connection when giving a Postback
The idea is to keep the user logged in to Chat as he navigates the pages. Layout of the components on the page Layout.cshtml function iniciarChat() { var chatHub = $.connection.chat;…
-
2
votes1
answer2950
viewsDropdown List from a table in the Database
I’m developing in Asp.net-mvc and I have the following problem: I need to create a dropdown list that displays the name of the instructors registered in the Database. CRUD is already working…
-
2
votes2
answers4299
viewsPicking attributes from an object using jQuery
How do I get the attributes of an object that is returned by a action in the javascript? This is my code ajax. Step the id for the action and it returns an object. I would like to access the values…
-
2
votes2
answers421
viewsJavascript variable value assignment
I have the JS code below and the return of JSON does not assign the value to variable texto. I did a test with alert(data.frase) and the message came normally. Would anyone know why to go texto does…
-
2
votes1
answer312
viewsReceive Token through Webrequest?
Guys is there any way I can generate a token through a Webrequest? Because every time I use the Google Drive function I need to open the authentication page only to generate the Access Token, there…
-
2
votes3
answers842
viewsCheck two or more occurrences of a listed element (lambda/Linq)
I have the following list<t> listCard; within it I have the following values: [0]:7720890002560 [1]:7720890002560 [2]:7777777002560 [3]:7720890002560 [4]:7720444402560 [5]:7720777002560…
-
2
votes1
answer836
viewsHow to use JSON on Asp.net MVC
I’m a beginner in Asp.Net MVC, and I’m developing an application that manages Courses and on my screen of enrollment I’m trying to do a validation that case the pupil is already registered in a…
-
2
votes1
answer180
viewsDoes Tempdata lose property when using Response.Redirect?
I have the following code on the pages that, to be accessed, it is necessary to log in: if (Session["Login"] == null) { TempData["msg"] = "É necessário realizar o login para acessar esta página!";…
-
2
votes2
answers511
viewsValidation via Javascript
In my application that manages Courses, I need a validation via javascript. I have a screen where the pupil makes his registration in a certain course, what I wanted is that when he click the button…
-
2
votes2
answers1084
viewsError 500 in ajax request with Asp.net mvc
Good morning, I got a problem I can’t fix. I made a simple ajax request in my code to fill the fields automatically if Cpf is already registered in the database. Well, the day I did everything…
-
2
votes1
answer316
viewsUnique authentication for multiple projects using Entity Framework
Currently in my Solution I have several ASP.NET web projects, each with the default authentication code of the Entity framework MVC (there are small customizations in the entities only). Projects…
asp.net-mvc entity-framework login forms-authenticationasked 7 years, 7 months ago Guilherme Ramos 35 -
2
votes2
answers431
viewsWeb system accessed by various companies appsettings
I am developing an application in ASP.NET Core, in which each company has its own database. The question is: how can I do for the company To access the site by putting user and password and access…
-
2
votes1
answer209
viewsAdding selected columns together
I have the following scenario: A table created in the Razor with several columns, where each row has a checkbox in place different from each other, and would like to do the checkbox sum clicked by…
-
2
votes2
answers2201
viewsPerson registration using multiple viewModels and only one controller
I want to register a person, which I have divided into three entities: Person, Contact and Address. And I want it to be just a registration form. My create action in the person controller looks like…
-
2
votes2
answers180
viewsField sorting of Join with Line in Mysql (C#, MVC)
I have the following query: query = from p in db.pessoa join f in db.pessoa_origem on p.Pessoa_Origem_Id equals f.Id join s in db.pessoa_status on p.Pessoa_Status_Id equals s.Id join c in db.contato…
-
2
votes1
answer246
viewsHow not to publish an Asp.net mvc configuration file
I’m separating my web.config in several files, for example, there is now connections.config that my web.config reference as follows <connectionStrings configSource="connections.config"/> I…
asp.net-mvcasked 9 years, 3 months ago Ricardo 5,680 -
2
votes1
answer552
viewsHow to accept 0 and negative values in decimal attribute using Dataannotations?
I have a class with values decimal which may receive a value of -10.00 to 10.00 (including 0), in Sql Server the equivalent value is a Numeric(5,2). The problem is that by creating my class…
-
2
votes1
answer1150
viewsC# MVC - Error after Publish on VS015. 404 Not Found
I did a "Publish" by VS2015 of the Web MVC type, but in the "Publish Method" I put "File System". The problem is that I published it on IIS and run the views, but when I click on the buttons it…
-
2
votes1
answer197
viewsJavascript and Activex permissions on IIS
Hello, an Asp.Net MVC application uses Scripting.Filesystemobject to create text files. On the development machine works normally, this application was published on an IIS server and also worked…
-
2
votes1
answer651
viewsChild actions are not allowed to perform redirect actions. MVC 5
On my homepage, there’s a shortcut button that opens a modal, and inside that modal is a partialView which points to a action within another controller. Until then quiet. <div class="modal fade"…
-
2
votes1
answer698
viewsHow to get Tempdata value with List<Object>?
Follows code: List<object> list = new List<object> { "abc", // string 1, // int true // bool }; TempData["ID"] = list; The following code cannot get value: var data = TempData["ID"]; var…
-
2
votes1
answer195
viewsSearch Data with jQuery
If anyone can help me: I’m doing an ASP.NET MVC system of academic control. At the time of enrollment, I wanted to put a blank field to enter the CPF, and other fields as the name, but only for…
-
2
votes1
answer706
viewsDoubt with @Style.Render
If I put in mine view Layout that line: @Styles.Render("~/Content/css") I’m stating that all the files .css in the briefcase Content will be rendered? I mean, I don’t need to put any .css explicitly…
-
2
votes1
answer87
viewsHow to read the IPTC header of an image through C#?
How to best read the IPTC header of an image ? I have the following image and I needed to read her description (for a database of images), but I have already researched many ways that for me were a…
-
2
votes1
answer3137
viewsCreate a dropdownlist and get the selected id Asp.net MVC
I need to create a Dropdownlist at runtime with 2 choices. With this, I need to do a check taking the selected record and then accessing such method. This after clicking on a ActionLink. How to set…
-
2
votes1
answer466
viewsAsp.Net MVC does not run Jquery after calling Action through "url:"
I need to call an Action using Ajax and until then everything right, I make the request as follows: confirm: function () { $.ajax({ url: urlToDelete + id, success: function () { //window.location =…
-
2
votes1
answer375
viewsWith export HTML string to PDF Compressed (zip)
I have this string: <HTML><HEAD></HEAD><body><FORM method="post"><table><tr><td>Nome:</td><td>JOÃO DA…
-
2
votes1
answer808
viewsASP.NET MVC and DDD
I am trying to use DDD and Fluent Api in a test application. I have the following question: I have a product register (in this case ink), when including a new product I put dropdownlist s, to force…
-
2
votes1
answer31
viewsUrlrewrite for photo name - Web
Today have the urls of my website images as: /images/tb/1280077_894mvzfxoojqb.jpg I would like to be able to rename this to the generated HTML Apartamento_em_SaoPaulo.jpg or something similar.…
-
2
votes2
answers829
viewsAsp.Net MVC Validators passing through the controller
When we create a project in Asp.Net it by default inserts some validators to be used with Razor, @Html.ValidationMessageFor(model => model.property). I saw in different projects that these…
javascript asp.net-mvc html5 validation jquery-validateasked 9 years, 2 months ago Luiz Negrini 1,424 -
2
votes1
answer122
viewsEdit two tables simultaneously in an "Edit" view
I have two tables: Pessoa and Catequizando, with a 1:1 ratio and want to make a "Get" to the data of the two tables, both "id s" are equal, so I did the Catequizando catequizando =…
-
2
votes3
answers185
viewsUpdate to 2 tables
I cannot update the 2 tables. The problem is here. db.Entry(catequizando).State = EntityState.Modified; db.Entry(pessoa).State = EntityState.Modified; db.SaveChanges(); Some solution? Controller:…
-
2
votes1
answer734
viewsMVC - Creating a typed model as a generic list
I would like to create a typed model being a list of the type T. Utilizing: Razor from ASP.NET MVC 5 For example: My model in the cshtml will look like this: @model List<T> @foreach (var item…
-
2
votes2
answers817
viewsI can’t implement a @Foreach on MVC
I’m a beginner in ASP.NET MVC development and I need some help. I’m having trouble creating a Foreach. Follow my code below. @foreach (var item in Model.Fornecedores) { <tr> <td>…
-
2
votes3
answers393
viewsSort children in consultation Linq
I’m having trouble making an ordination in a query where I have to sort the children by the ID, Follow the Source. public Grid GetByOrderGridData(long id) { var query = from c in…
c# asp.net-mvc entity-framework linq lambda-expressionsasked 7 years, 4 months ago Thiago Ubiratan 353 -
2
votes1
answer1240
viewsHow to set up my website homepage?
Usually I create my websites in MVC using the default template that comes in Visual Studio. Today I created a new project without using a template and when testing it I received an error: A standard…
asp.net-mvcasked 7 years, 4 months ago Italo Rodrigo 4,344 -
2
votes1
answer164
viewsRepository Pattern - Usage Doubt
Good night, you guys. I was developing a software and started thinking about what would be the best way to implement the Repository Pattern. I have to return to the data controller of cities and…
-
2
votes2
answers571
viewsPass generic model to controller
My project follows the following model: In my Controller I have the following: I noticed you might be using this ActionResult dynamically. My view is typical. I wonder if there’s a way to pass the…
asp.net-mvcasked 9 years, 2 months ago Rafael Barbosa 2,855 -
2
votes3
answers706
viewsHow to select value in Select
How to select a value that is not the first according to an ASP.NET variable Razor C#. <select id="MeetingFrequency" name="MeetingFrequency"> <option value="0" selected…
-
2
votes0
answers160
viewsDirectory permission for the entire domain
I am trying to create a folder and assign it read permissions: public static void createFolder(string path) { DirectorySecurity securityRules = new DirectorySecurity();…
-
2
votes1
answer372
viewsInsert data with LIST into ASP.NET MVC
I am trying to insert training record into a list that is being used in place of a database, but somewhere in the application it gets lost and the list keeps only the record that was entered via…
asp.net-mvcasked 9 years, 2 months ago Kelly Soares 1,181 -
2
votes1
answer26
viewsProxy Error in Google Trends
I’m using Google Trends on ASP.NET MVC 5. Whenever I run my application in Visual Studio Google Trends automatically blocks my proxy. What could be causing this?
asp.net-mvcasked 7 years, 3 months ago João Afonso Tchiloya 21 -
2
votes2
answers2426
viewsDisplaynamefor and Displayfor
Studying about ASP.NET MVC, I came across the following lines of code: @Html.DisplayNameFor(model => model.Title) @Html.DisplayFor(model => model.Title) I can’t understand the difference…
-
2
votes1
answer2708
viewsHow to configure ASP.NET MVC validation to accept en-BR dates?
I can’t get the date formatting right in my forms. I tried several cases, all using the same view: @Html.EditorFor(model => model.Data, new { htmlAttributes = new { @class = "form-control" } })…
-
2
votes1
answer148
viewsSending post to Actionresult via knockout
Speak people, next: I’m trying to send one post using the ko, for a method ActionResult of my controller instead of a JsonResult as usual. When debugging the project it enters the ActionResult but…
-
2
votes1
answer94
viewsHow to implement jQuery Filer Plugin?
I’m trying to implement a component for uploading images with thumbnails, and I’ve spent a lot of time looking for one that suits my needs. After a day of searching I found jQuery Filer. Anyway, I’m…