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
votes1
answer116
viewsSending new value to all users via signIR
I need to make all users receive the updated values on their screens as soon as the function AutonavHub.client.printPackageInfoFloat(objeto) is called within $scope.adicionar = function (objeto)…
-
3
votes1
answer7943
viewsPass parameter to a C# MVC Controller
I am learning programs in ASP.NET MVC C# and would like to know how I pass a data from a textbox to a controller. That is, I want to enter a value(id) in the View Index in a textbox and when I click…
-
3
votes1
answer196
viewsHow to call another class column name in Webgrid MVC
I have this view Listar.cshtml @model IEnumerable<ODM> @{ var idGrid = "grid" + this.ViewBag.IdParameters ?? string.Empty; var grid = new IBM.Web.Helpers.WebGrid(id: idGrid, rowsPerPage:…
-
3
votes1
answer1030
viewsConvert String to monetary value in ASP.NET MVC
How to convert the result of a multiplication into a string to display as Real? The value of bol.ValorBoleto is loaded just before. To data Annotation: [DisplayFormat(ApplyFormatInEditMode = false,…
-
3
votes1
answer478
viewsA dynamic field for each database record
I have a property called Productdevelopment where I have several functions and must assign a user to each function. I have an Editortemplate to return a list of users. I have to create a dynamic…
-
3
votes3
answers1160
viewsValidation to check if the record is being used before deleting
The MVC of my project is stuccoed in services, controllers, Views and models. My deletion screen works, but when the record is used in other tables it displays this error. The DELETE statement…
-
3
votes1
answer420
viewsError while trying to pass a controller list to view ASP NET MVC
Good morning, everyone, I’m new to development, and I’m having trouble passing a list of a controller query to a view. I did some research and all the ways I found didn’t help much, if anyone can…
-
3
votes1
answer1291
viewsThe method or Operation is not implemented error
When I will add a record on my Include screen, I get this error. What can it be? Service public void AddItem(Test item) { var codigos = this.context.Tests.SingleOrDefault(x => x.Codigo ==…
-
3
votes1
answer1201
viewsError after configuring Authorization on Web.config
I’m having trouble accessing the MVC application right after setting up in Web.config to authenticate with the windows user. Error occurs when enabling the following line: <authentication…
-
3
votes1
answer1072
viewsApplication pool hangs and no back application
I have a system in MVC4 on . NET 4.0 that is running on IIS 7. It generates the following error in Event Viewer: Event code: 3005 Event message: An unhandled exception has occurred. Event time:…
-
3
votes2
answers254
viewsScaffold MVC Template Editing. How to get project reference in Solution Folder?
I am editing the T4 templates from ASP.NET MVC’s Scaffold and I need to get some extra class information. At first, for example, of the attribute DisplayName class. I found some examples: var env =…
-
3
votes1
answer390
viewsEnter additional data, from the bank, into the user’s Claims. What is the best time or the right way to do it?
I have some extra information that I need to add to the user’s Claims that are from other tables and classes. Considering the method generated by the ASP.NET MVC template with Identity in the class…
-
3
votes3
answers761
viewsError Calling Jquery function
I have the following button: <button class="btn btn-default details" data-id="@fornecedores.Codigo"><i class="glyphicon glyphicon-file"></i></button> On the same page I have…
-
3
votes1
answer100
viewsUse/Escape @ in CSHTML view
I have a jQuery code on the CSHTML page and I’m having trouble validating the email with a regular expression, because the @ is a Razor command in .NET. How to proceed to resolve this issue? Follows…
-
3
votes1
answer184
viewsViewdata["Errormessage"] does not appear in view
Hi, I’m new to c# and would like to know why my Viewdata["Errormessage"] does not appear in my view. Controller: ViewData["ErrorMessage"] = "O e-mail digitado já se encontra registrado em nossa base…
-
3
votes1
answer257
viewsWhat is GUID for Visual Studio projects
I have a "base" project in C# MVC (login, access control and related), to replicate in other projects, which consists of copying the fonts and sometimes renaming the project. Do I have to change the…
-
3
votes1
answer1210
viewsQuery using the Entity framework
Within my repositorioEF I have the methods, in the method ExcluirRegistro I’m passing a StatusRegistro for the bank indicating that this record is being deleted, then in my methods ListarPorId and…
-
3
votes1
answer148
viewsController dependency injection with Ajax
Good afternoon, I am using ASP.NET MVC 5 with Windsor and when an Ajax request calls a method in the controller, the error informing that the controller has unsatisfied dependencies. How do I work…
c# asp.net-mvc ajax dependency-injection castle-windsorasked 9 years, 2 months ago Alan Almeida 633 -
3
votes1
answer237
viewsRemove EF dependencies without using the Myconfiguration class
I am trying to create an application by removing all EF dependencies and leaving only the necessary layers: Repository and Applying. I did a small project to test the operation before applying in…
-
3
votes1
answer887
viewsSending via Formcollection of monetary values
I need to send to a method in Controller, the values filled in the column Payment_value as shown below: By clicking the green button, send via post, the values of the list below that generated the…
-
3
votes1
answer580
viewsPass Parameters to Store Procedure
Follow the Search Function Code public List<Pessoa> Buscar(string Nome) { using(var db = new MyContext()) { var Result = db.Database.SqlQuery<Pessoa>("EXEC SP_Busca_Cliente @Nome",…
-
3
votes1
answer1485
viewsCreate tabs dynamically in excel
I am doing an MVC project and I would like to know if there is any way to create dynamic tabs in Excel according to filters and export it later. Example: If the filter only comes with "School"…
-
3
votes3
answers721
viewsWhy isn’t onBlur being executed?
I was wanting to run a function in Javascript when the dropdown lose focus. I’m doing it this way, using onBlur, and it’s not working: function DesabilitaFiltro() { alert("ok"); } <div…
-
3
votes2
answers122
viewsIs it correct in MVC to access data within the model?
In a C# MVC project, it is correct to access data within the model? For example: public class Cliente { public int Id { get; set; } public string Nome { get; set; } //outros atributos... public void…
-
3
votes2
answers141
viewsError while trying to pass an ordered collection to a View
I’m trying to get to the View an ordered collection, but I’m always having the same error: There is no Viewdata item of type 'Ienumerable' that has the key 'Titulodecortesia' The only way I can…
-
3
votes1
answer828
viewsGetenumerator error while rendering a View
I did it just as a test: @model Operador.MVC.Models.OperadorModel @{ ViewBag.Title = "Operador"; } <table id="tblOperador" class="table table-hover table-striped" border="1" cellspacing="0"…
-
3
votes1
answer106
viewsFood list gives "Index out of range"
In my system, I need to return to the number of questions that the student missed on a particular topic. To achieve this, I tried creating a class that has two attributes: Tema and QteErros and…
-
3
votes3
answers455
viewsLINQ with JOIN and Where clause, how to do?
Good afternoon. I’m trying to make a left outer join (SQL) with LINQ, however, I’m not getting. The code of my class, is this one below. Can anyone give me a light on how I solve this? public class…
-
3
votes2
answers734
viewsError passing values to @Html.Dropdownlist
Man Controller: public ActionResult AssociarDependencia(int codigoMilestone, int codigoAtividade) { try { using (CPMDatabaseEntities db = new CPMDatabaseEntities()) { List<Atividade> lista =…
-
3
votes1
answer124
viewsDisplay a button based on the action of another
I’m a beginner in Asp.net MVC I have a project. And within a certain view I have two buttons. However, one can only appear if the other is executed. 1 Button > Save (save car) 2 Button>…
-
3
votes1
answer83
viewsSecurity Attributes
A friend asked me how to give more security in your application, to avoid a kind of "url injection", IE, someone manually type an "addicted" url and bypass the system. Of course, there are several…
-
3
votes1
answer117
viewsAccessing data stored in cookies?
In login, I store user information logged in to a cookie (name, password, etc...) How do I access this cookie and redeem information from it? For example, I want the name of the logged in user to…
-
3
votes2
answers1067
viewsHow do I print to dot matrix printer on the client with a web application?
I have an application made in C# MVC with a routine to print a plain text on the standard printer. The method was used RawPrinterHelper.SendStringToPrinter that is described in this article.…
-
3
votes1
answer742
viewsEntity cannot be referenced by multiple instances
I’m trying to save the data in this method here... public ActionResult AtualizaInicioAtividade(Atividade atividadePre, Atividade atividadePrincipal) { try { using (CPMDatabaseEntities db = new…
-
3
votes2
answers108
viewsMemory Leak in Xmlserializer
I have the code below. How the method is static and the XmlSerializer does not implement the Dispose, at each call of the method, the system stacks in memory or the GC (Garbage Collector) can clear…
-
3
votes1
answer269
viewsActionresult or Jsonresult returning Json?
I see many codes in Controller where it is used as a method ActionResult returning Json(), but I also see an approach using the JsonResult logically returning Json. Is there any difference between…
-
3
votes2
answers719
viewsRefresh ajax mvc core page
I need to close a modal, and refresh the page, I’m doing this way: function closeModal() { $('#myModal').modal('hide'); location.reload(); } But the first time it doesn’t work, and then it works…
-
3
votes1
answer165
viewsDropdownlist in C# with Htmlhelper
I’m new here and also new to the universe ASP.NET. I’m having a hard time creating a DropDownList for a form on a web page with ASP.NET MVC and C#. I made a user registration form and one of the…
-
3
votes4
answers1437
viewsGet user logged in to Asp.Net Core 2.0
How do I get the User who is logged in to the class ? I’m trying this way: public class Teste { private readonly UserManager<Usuario> _userManager; public Teste(UserManager<Usuario>…
-
3
votes2
answers404
viewsPublication of ASP.NET MVC Project
Good morning gentlemen, I work in systems development, but until then I never had to publish on the internet an application of mine, because I have always worked with projects ready, what is the…
-
3
votes2
answers419
viewsError creating data with foreign key
Hello, I am not able to insert data in a table that has foreign key, follow my model: 2 tables, Departamento and Funcionario, the official has the foreign key IdDepartamento. And I ran the…
-
3
votes1
answer551
viewsLoad txt file through a list c#
I make a query in the bank and put it in a list, then see each item of the list through the foreach to view other tables according to the Id of each row traveled. If found, I would like to upload a…
-
3
votes2
answers126
viewsEdit MVC with Foreign Key
I need to upgrade my editLivros, Next I’ll explain my project. Autores ------- IdAutor Nome Livros -------- IdLivro Nome IdAutor I am registering the Authors and Books correctly, when I am…
-
3
votes2
answers721
viewsHtml.Editorfor value Default
How could you put Default value on a Html.EditorFor ? Understanding my code, I have a field that’s a filter when I click on EditorFor open the calendar, I’d like the datetime.now but only visual…
-
3
votes0
answers61
viewsRelationship between classes Asp.Net Identity
I’m a beginner with Asp.net, I’m making a site with scheduling times for a barbershop, using Asp.Net’s Identity for authentication and authorization of users. However, I am in doubt whether it will…
asp.net-mvcasked 6 years, 4 months ago Pedro Tomaz 131 -
3
votes1
answer102
viewsWhat is the difference between the settings properties <Compilation> and <httpRuntime>?
I am going through some problems while learning to work with C#, more specifically with Asp Net MVC. I saw a setup snippet on Web.config that left me a little confused, knowing: <compilation…
-
3
votes3
answers1778
viewsScaffolding error during View generation
I am creating a new project using EF Power Tools and I have the following error: Error There was an error running the Selected code Generator: 'A Configuration for type 'TST2.Models.Course' has…
-
3
votes1
answer128
viewsValidate by js with for each
On this screen I need to do a validation so that in each record, when the record has permission, in case it is marked bring me the record marked with it every time I edit (mark or deselect the…
-
3
votes1
answer409
viewsDropdown Cascata
My problem is passing values to controller when making an update. I can do the Cascading all right. Follow my code. First DropDown: @Html.DropDownList( "idCanalIndicadoresMassivo",…
-
3
votes1
answer723
viewsHow to calculate Total via Javascript
To show the items of a sale I use a Json to show the data using this script. <script> $(document).ready(function () { var CodigoVenda = @ViewBag.CodigoVenda; $.ajax({ type: "GET", url:…