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
-
1
votes1
answer183
viewsActionlink on a list without reloading page
I have a conventional list generated by Asp.Net MVC. In the items I put an Actionlink to change the status of the item from Pending to Finished. Every time I click on the link it reloads the page.…
asp.net-mvcasked 9 years, 4 months ago Marnei 45 -
1
votes1
answer95
viewsBetter options to SESSION?
I have always heard many people say that SESSION is not performative and that it was not advisable to use SESSION in applications . NET, but so far I haven’t found anything I can use in place of…
-
1
votes0
answers89
viewsDoubt with SSL/TSL and Asp.net mvc
I made an application for testing and in the project I changed the field SSL Enabled to True. The application has two URL’s, one for HTTPS and the other for HTTP. Ex: https://localhost:44338/…
-
1
votes2
answers858
viewsProblem to run "Update-Database"
I’m following the tutorial of this video to set up an ASP.NET MVC project using Entityframework6. The database used in the tutorial is Sqlserver and what I’m trying to use is Mysql. I already have…
-
1
votes0
answers164
viewsERR_CONNECTION_TIMED_OUT when Running Project by Visual Studio
I have this error while running my project. I have already searched for this error on other sites and found no answers. Unable to access this site localhost took a long time to respond. Search…
-
1
votes2
answers412
viewsError Saving EF Changes
Good night, When trying to insert data into table me error "An error occurred while updating the Entries. See the Inner Exception for Details.". var db = new Repositorio(); var perfilPessoaDB =…
-
1
votes1
answer42
viewsTwo databases communicate with the same template
I wanted to have a database for production and another for development separate the real data from the test environment data. The problem is I have no idea how to do that. I created a clone of my…
-
1
votes1
answer1927
viewsDisplay the return of a query with 2 tables in the same View in ASP.NET MVC
Controller: using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using HelloMobile.Models; namespace HelloMobile.Controllers { public class…
-
1
votes1
answer242
viewsHow to create a webgrid with dynamic columns?
I saw several examples using Webgrid but all with the number of fixed columns. My data source will return a dynamic list, IE, either returns 5 columns and then can return 6 columns, how to do ?…
-
1
votes1
answer54
viewsLog data through different View
I am beginners in Asp net mvc and would like to know how I can register data from an entity going through different View from the same Controller Thank you !!
asp.net-mvcasked 7 years, 6 months ago Alerf Morais 121 -
1
votes3
answers52
viewsI did a project using the VS2015 SPA template. I want to take the start login page
I made a project and when I rotate it is the login page that is the first to be shown. I would like to know how I make to leave the home page as main and not login. How I do this?
-
1
votes1
answer168
viewsMy controller can’t find the view
I made a controller called Email. In the ActionResult i give an Add View and create the view. When I right click on the ActionResult and give a Go to View, says he didn’t find the view, but if I…
asp.net-mvcasked 7 years, 6 months ago pnet 14,727 -
1
votes1
answer29
viewsDisplay an Enumdropdownlistfor as a condition
How to present a EnumDropDownListFor as a condition? For example, if the user wishes to inform his or her sexual orientation Enum is presented. Otherwise it is not presented.…
-
1
votes1
answer89
viewsLoss of Collection from a View Model to the Controller
I passed an object containing a collection with 2 objects of a controller to the view typed form. Now I would like the view pass this same object to another controller. The call URL passes the Model…
-
1
votes2
answers63
viewsHow do I get the usermanager property started in my Model
I wanted to form the field Name is automatically filled in by the username you are logged in to. How to include this property in mine Model? public class Condominio { public int CondominioId { get;…
-
1
votes1
answer91
viewsHow to perform the Submit of a form with Onsenui and Angularjs?
How to proceed to perform a Submit with Onsen UI + Angularjs? I got the following ons-page: <ons-page ng-controller="LoginController"> <ons-toolbar> <div class="center">Acesso ao…
-
1
votes2
answers725
viewsLimit Editfor input in MVC
I have a character limiter for TEXT only. Now I need the characters to be limited in only 2 (I want to make the user type the state, for example: PR, SP, RJ...). How I do it?…
-
1
votes1
answer1018
viewsError "Access-Control-Allow-Origin header is present on the requested Resource"
I need to insert an API on my site that brings the weather forecast for a certain city, however, the request ajax always returns the error in the browser console. Below: XMLHttpRequest cannot load…
-
1
votes1
answer527
viewsReturn database value to textbox Asp.net MVC
As return a value of a column of the bank sql for a textbox in asp.net mvc ? I created the textbox, created a property inside a class. <label> @Html.DisplayNameFor(model => model.IRPJ) :…
asp.net-mvcasked 9 years, 3 months ago AndreeH 1,333 -
1
votes1
answer249
viewsReturn and assign to a query result textbox
How to return the result of a query and assign to a textbox in Asp.net mvc ? The "Type" is a Textbox from another screen, as I can record it and play it as a parameter for the query ? This method…
asp.net-mvcasked 9 years, 3 months ago AndreeH 1,333 -
1
votes1
answer79
viewsGrab Control Not Typed in View Typed
I need to take the page post the elements that I’m not creating from the model, for example the input with the id "type". How can I catch him in the process ActionResult the elements are not created…
-
1
votes0
answers22
viewsDivide a view into tabs
I have a very large registration form, I want to divide it into Tabs, and the button to register the data should be in the last View that contains the form How can I do that ?
asp.net-mvcasked 7 years, 5 months ago Morais 83 -
1
votes1
answer631
viewsError converting HTML to PDF using Xmlworkerhelper
While exporting the HTML file to PDF using iTextSharp and Xmlworker error occurs in some situations saying that certain tag is not closed and searching found this post How to Convert HTML to Valid…
-
1
votes4
answers2106
viewsValue treatment null c#
I have a method that generates me an execption, how to treat this?: I thank you public string CarregaProdutosDermaClube(string codigoproduto) { //consulta os dados var tbuscar = new…
-
1
votes0
answers164
viewsAjax error null return value
I have a function in ajax: $.ajax({ type: "POST", url: "@Url.Action("FiltraLevatamento", "Consulta")", data: JSON.stringify(jsn), contentType: "application/json", dataType: "json", async: true,…
-
1
votes1
answer571
viewsAsp.NET MVC checkbox list bind with string value
I have a checkbox list and need to bind values that are strings (@item.Selectedvalue) with my Ienumerable>. <div class="editor-field perfil-filtro-expander-todasAcoes"> <div class="metro…
-
1
votes1
answer192
viewsPass Switch to Controller
I have been looking for a solution for several days but I haven’t found anything useful to me. The problem is this, I have a Conttroller receiving data from View, so far so good, but when I capture…
-
1
votes2
answers2012
viewsSystem.Outofmemoryexception error
I don’t know how to solve this problem: As noted by Marcos Marques this is about the size for each record in total of 4 thousand records. Where can I improve the code: public ActionResult…
-
1
votes1
answer580
viewsHow to use javascript code inside if Razor?
In my view, I have code following: <script type="text/javascript"> @if(Model.File == true) { //Como usar javascript aqui ? //Exemplo: $("#target").click(function() { alert("Handler for…
-
1
votes1
answer195
viewsSelect two attributes from two different tables in a view
I have the model (superclass) Pessoa and the model Aluno public partial class Pessoa { public Pessoa() { this.Escola = new HashSet<Escola>(); } [Key] public int PessoaID { get; set; } public…
-
1
votes1
answer381
viewsSeparate Context Asp.Net Identity and Application Context
I am creating a repository using the Entity Framework, and the need arose for my entities to communicate with the entity Identityuser of Identity, only that Identity is on a separate layer of my…
-
1
votes1
answer379
viewsView Popup asking for authentication when you click on a screen component that you are not allowed to change
How to create a mechanism for when the user clicks to try to change a date that is like datepicker and display a popup for authentication or something like that to make that change? If he has…
-
1
votes1
answer499
viewsHow to dynamically grab the Content folder directory?
My question is the same as the title: how to create a variable that points to the Content folder? I have a file there and I want to access it. I tried so but unsuccessfully: StreamReader file = new…
-
1
votes2
answers877
viewsHow to create field dynamically with jQuery?
I have a Function that I need to validate what the user has typed, if applicable true enables the datepicker. But the way I did, you’re falling for the method POST of asp.net mvc. There is a way to…
-
1
votes1
answer159
viewsLinq function does not return List
Hello, I have an application and it does not return a list I select via Linq-to-Sql The error may be in the SELECT that Linq-to-sql is doing. SELECT [Extent1].[Codigo] AS [Codigo],…
-
1
votes1
answer56
viewsCollect data from View to the controller
I would like to know how I can collect a data from View, since I am already using @model System.data.dataset. @model System.Data.DataSet @{ ViewBag.Title = "CadastroPorto"; } I need to collect the…
-
1
votes1
answer99
viewsTo consist of the back button page in MVC
I have a web application . net mvc of satisfaction search, where the user preserves all the data and clicks the button to finish. The system records the survey data and redirects it to another page…
asp.net-mvcasked 7 years, 4 months ago Eduardo Pina 11 -
1
votes3
answers163
viewsViewdata is not displaying message
I’m trying to send a message from Controller to View using Viewdata, but it’s not displaying the message. When I click on the "Check" button of the View it is to call the method Verificar() from…
-
1
votes2
answers1921
viewsCreate Reportviewer in Asp.Net MVC
How to create Reportviewer in Asp.Net Mvc 4 ? The Report is done, just need to create Reportviewer with the options to export pdf, excel and word. Example: <rsweb:ReportViewer ID="ReportViewer1"…
-
1
votes1
answer317
viewsPut the bug in my view
How do I play these messages in my view? Code that returns the message: public ActionResult SaveInternalAuditRecord(InternalAuditRecord criticalAnalysisRecord, string idResponsibles, string…
-
1
votes1
answer140
viewsProblem creating Reportviewer in Asp.net mvc
I installed the package "Install-Package Mvcreportviewer" via Package Manager Console and when trying to create Reportviewer gives an error not found the reference. My code: View @using…
-
1
votes1
answer78
viewsCRUD error with . NET MVC
I am trying to recover some data from my database but is giving the following error Specified key was Too long; max key length is 767 bytes I have no idea what’s going on. User class public class…
-
1
votes1
answer77
viewsSet virtual field name
I have the following code in my model SubGrupo: namespace Aplicacao.Core.Dominio { public class SubGrupo { [Key] public int Codigo { get; set; } [Required(ErrorMessage = "Campo Obrigatório.")]…
asp.net-mvcasked 9 years, 2 months ago Rafael Barbosa 2,855 -
1
votes2
answers782
viewsHow to make space in the checkboxlist text created dimanically
I’m trying to give a space between the checkboxlist square and the text, but it’s not working, I followed the code. <div class="form-group"> <asp:Label ID="Label2" Text="" runat="server"…
-
1
votes1
answer50
viewsRedirect to Action according to if
I have a Controller: [HttpPost] public ActionResult Login(string pUsuario, string pSenha) { usuario oUsuario = modelOff.usuarios.Where(p => p.usuario1 == pUsuario && p.senha ==…
asp.net-mvcasked 7 years, 3 months ago Italo Rodrigo 4,344 -
1
votes2
answers724
viewsRazor in javascript file
I have a little code that works on _Layout: $.ajax({ type: "POST", url: "@Url.Action("Action", "Controller")", success: function () { //Seu código aqui ... } }); So far, so good, only _Layout is…
-
1
votes0
answers15
viewsAmount of files in Moq request
The SetupGet to for the form (Form) of the request works, however the Count doesn’t work. How to solve for the Count return the desired value? var httpContextMock = new…
-
1
votes1
answer283
viewsCharacter limiter in ASP.NET text-box
I’m trying to implement a character limiter for this text-box, but I have no idea how to do that. It is an insertion page of posts in a portal and the title needs to have a limit. <div…
-
1
votes1
answer797
viewsHow to include a line at the beginning of a text file?
My system generates a text file, and based on the sum of an information that appears on each line, it makes the calculation of a checker digit. However, this result should be in the first line of…
-
1
votes2
answers337
viewsNo Entity Framework provider found for ADO.NET provider
I am splitting my application in layers, I installed the EF in the application layers and repository, in my view everything is correct, but I am having the following error: No Entity Framework…