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
answer446
viewsSeparator of thousands
How could you put thousands apart into one textBoxFor()? Example: Value entered in View 1,321 ( The point is for visual ease only) controller would receive the 1321 value to insert into the base. My…
-
2
votes1
answer1326
viewsHow to validate a field To accept only Letters/Numbers using Regex
I am creating validations for every Property of my classes. I am using a component called AbstractValidator. Example: protected void ValidarChamadaTipo() { RuleFor(p => p.ChamadaTipo)…
-
2
votes2
answers53
viewsSave Status Code in variable and check
I need to save Statuscode and do a check. I have the following code: using (HttpResponseMessage response = await httpClient.GetAsync(UrlApi)){} When I do that: var teste2 = response.StatusCode; the…
-
2
votes1
answer1637
viewsUser and password validation in Pop Up Modal using MVC 5
My problem is this. I have a modal login pop, as shown below. That when the user enters his login and password and clicks on the login button, he calls mine controller Authenticate. Follow the code…
-
2
votes1
answer1537
viewsDoubt with passing Parameter Asp.net MVC
Calling the controller is no longer calling the Actionresult (Solved) I have my view: @model IEnumerable<Generico.Dominio.TB_MENU> @{ ViewBag.Title = "Index"; } @Html.Partial("_navbarInterno")…
-
2
votes1
answer594
viewsProblems sending e-mail Asp.net.mvc
The SMTP server requires a secure connection or the client has not been authenticated? [HttpPost] public ActionResult Index(string login) { try { var tbuscar = new UsuarioAplicacao(); var retorno =…
-
2
votes2
answers261
viewsDo not show 1 row of empty array using Angularjs Asp.net mvc?
I have the following code: <head> <meta charset="utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <!--inserindo a meta tag de keywords onde definimos as palavras…
-
2
votes2
answers108
viewsCheck if call came from API (.Net Core) or MVC
I have some applications that need to share the same Repository (Class Library). The Repository project is created and working, with MVC applications. The problem is that it searches for the…
-
2
votes1
answer38
viewsBuilder is coming empty
I am making a program in Asp net web apllication, but when I try to communicate the controller with the service the constructor this null saind, the dependencies are already configured in the…
-
2
votes1
answer82
viewsWhat is the build flow of the . NET framework?
I’m starting my walk on .NET. I’m programming in ASP.net but I can’t understand how an Asp.net project turns into html + javascript. I suppose there’s a compilation process behind it. Apart from…
-
2
votes1
answer222
viewsAsp.net Sqlexception: The INSERT statement conflicted with the FOREIGN KEY Constraint
There is a question similar to this one, but it’s different ..... my doubt is where to find where it gets this information.. is it in the view form? or controller? There are several Partials views…
-
2
votes1
answer272
viewsOn which layer should I create constants in my application with DDD concept?
I’m using the DDD concept (Layers: Presentation, Application, Domain, Data and Crosscutting) in my ASP.NET Core MVC application and I was wondering about the best place to create my constants. In my…
-
2
votes2
answers2325
viewsError 500 when consuming Nfedistribuicaodfe
I’m trying to consume the NFE download service on the farm: https://www1.nfe.fazenda.gov.br/NFeDistribuicaoDFe/NFeDistribuicaoDFe.asmx Specification…
-
2
votes2
answers286
viewsIs it possible to send Ienumerable typed view data to the Controller?
I am sending data using a get and receive in the controller using a Querystring, the problem is that the value goes in a format without the decimals, so when I have a value like 10.20, this sending…
asp.net-mvcasked 8 years, 10 months ago Harry 3,805 -
2
votes0
answers712
viewsASP.NET MVC - Alternative to the DDD
I will start building an application let’s say, initially small, about 5 Cruds and only 1 Core (this yes a little more complex in terms of business), but the goal is that it grows over time, using .…
c# asp.net-mvc entity-framework pattern-design software-architectureasked 8 years, 10 months ago Guilherme Ferreira 369 -
2
votes1
answer91
viewsarterySignalIr/Ping - What is causing this error?
The project MVC in C# here the company is with a very bizarre bug, to say the least. From time to time a random error bursts: The controller for path ...arterySignalIr/Ping was not found or does not…
-
2
votes1
answer44
viewsSave Ienumerable<T> inside a parent entity with LINQ
I have the following classes: public class Foto { [Key] public int Id { get; set; } [StringLength(500)] [Required(ErrorMessage = "Obrigatório")] public string Nome { get; set; } public int Item_Id {…
-
2
votes1
answer266
viewsSelect inside a dropdown using jquery
I can’t get the script to work. I have to do research into the second Dropdown (Scams) and save the ID of the second dropdown to make the Post the ID in the BD Controller: This Controller will seek…
-
2
votes1
answer123
viewsAjax - Protect Webservices
I am building an Asp.net MVC application and make many calls to actions and webservices via ajax (jquery or Angularjs). How could I hide these calls, or ensure they are made only by my app? For…
-
2
votes3
answers1955
viewsAjax works locally, but does not work on the server
I have an application on Asp.net mvc 5 where the code below works locally (visual studio 2012), but does not work after the publication on the server. controllerAction = "/Controller/Action/"…
javascript jquery asp.net-mvc ajax visual-studio-2012asked 8 years, 10 months ago Thiago Rodolfo 129 -
2
votes1
answer35
viewsMVC Read Agility
I have an application in MVC 4 that has no addition/deletion/editing operation, it only reads and provides data (as filters). The data basically comes from 4 views. Being the first of about 1,500…
asp.net-mvcasked 8 years, 10 months ago Rafael Barbosa 2,855 -
2
votes1
answer1368
viewsUse of search/search filters with Entity framework
I am creating a grid with book data and I am adding some filters, the problem is time to create the filters of a table that has a link with books, I can’t navigate(Obs.:in the view I can navigate in…
-
2
votes2
answers355
viewsLambda, Where com subconsulta
I need a consult like that on the lambda SELECT ClienteId --Aqui eu tenho varios campos do Cliente e estagioprocesso FROM Cliente WHERE ((SELECT TOP (1) EP FROM estagioprocesso WHERE…
-
2
votes1
answer518
viewsModel arriving empty in controller
I basically have a Controller who sends a iList to the View, that one View could edit any record of that iList, but when the Controller receives it is already empty. I did so: Controller: public…
-
2
votes1
answer271
viewsEntity framework Many-to-Many Ientitychangetracker error. How to resolve?
I have a Many-to-Many relationship and my tables are correct about the relationship in the database. The problem is that my insertion works perfectly when you don’t use an existing entity in the…
-
2
votes1
answer160
viewsLEFT Outer Join does not work on LINQ when 0 is the reference? null only
I’m having doubts on Left Outer Join, I’m using MVC 5 C#, Net 4.5.2. I have the following Model Fornecedor public class fechamentoFornecedor { public int FornecedorId { get; set; } public int Tipo {…
-
2
votes1
answer437
views@Html.Editorfor Datetime property remove hh:mm:ss
In my model have a field DateTime called Dating, I graduated with Attributes, but when I’m in view is filling in hh:mm:ss I just want the date 29/02/2016. Model [Column("sdt_DataReferencia")]…
-
2
votes1
answer345
viewsChosen ASP.NET MVC plugin
I’m trying to use the plugin chosen (http://harvesthq.github.io/chosen/) with the DropDownListFor, but when using this plugin the field validation not working. Box.cshtml @model CaixaViewModel…
c# asp.net-mvc validation chosen-jquery-pluginasked 8 years, 8 months ago Pablo Tondolo de Vargas 5,444 -
2
votes1
answer594
viewsLinq + Lambda, sub-query, distinct and not in, how to improve this query
I had the following syntax in SQL SELECT tbl_boleto.int_IDC, tbl_Admin.int_STATUS, tbl_Admin.int_CONVENIO, tbl_Admin.int_PLANO, tbl_Admin.int_RESTRICAO, tbl_Admin.str_URL FROM tbl_boleto INNER JOIN…
-
2
votes2
answers352
viewsHow to receive the view model in a GET request Webapi?
Okay, I have a problem with my API here, and I’d like to ask for your help. I have here a form in Knockout JS, I serialize a constructor that in turn returns me a querystring so API?…
-
2
votes2
answers973
viewsInheritance X Composition - Mysql C# Entity
There was a doubt of inheritance modeling in C# involving the entities Pessoa, Pessoafísica and Pessoalegal, but Gypsy Morrison Mendez helped a lot! Now I have another question in another type of…
c# asp.net-mvc entity-framework inheritance compositionasked 8 years, 8 months ago Felipe Bulle 387 -
2
votes1
answer169
viewsIs outputcache only valid at controller level?
I’ve been reading the article: http://www.asp.net/mvc/overview/older-versions-1/controllers-and-routing/improving-performance-with-output-caching-cs And I started using the: [OutputCache(Duration =…
-
2
votes2
answers576
viewsIntegration of two different applications in ASP.NET MVC
Hello, I need to integrate two different applications: one is a client business administration application and the other a financial management application. They are two separate applications, so…
-
2
votes1
answer1139
viewsWeb API - Token
A MVC application accesses WEB API services. To access the WEB API it is necessary to inform a "token". In the WEB API application there is a button that generates the token. How to make the WEB API…
-
2
votes1
answer136
viewsValues calculated in Javascript do not appear with decimals
I’ve been doing this calculation, which is working perfectly. The problem that is occurring is that when you return the values to the screen (View) returns without the calculated decimal places.…
-
2
votes2
answers2833
viewsHow to upload . txt file and save to a directory using c# net mvc?
I would like to upload text files where I select N files. txt and saved in a directory I specified in the application; I made an example that was on the internet but could not get the files in my…
-
2
votes1
answer121
viewsInvoke selected Checkbox values in View Edit
I don’t know how to return the values selected in checkbox to the View. Controller: public ActionResult Editar(int? id) { // acedendo a um conjunto de valores de uma classe ViewBag.Daylist =…
-
2
votes1
answer375
viewsDoubt with Array in C# returning data in Json
I have a structure that returns me the results of the header and detail, only that the records duplicates according to the details, as I could bring only 1 time the header, I appreciate the help.…
-
2
votes1
answer65
viewsEntity Framework - Relationship Association Problem 1 to 0.. 1
I have a problem of association between two tables. Student and Student Tables. Public class Aluno { [Key] public int cod_aluno { get; set; } ........ public virtual Aluno_Unidade_Curso…
asp.net-mvc asp.net-mvc-5 entity-framework entity-framework-6asked 8 years, 7 months ago Rodolfo Araujo 23 -
2
votes1
answer137
viewsUser add date to List MVC 4
I am new to ASP.NET MVC 4 and C# and need help. I have created a Enrollment class (discipline) public class Enrollment { public virtual int EnrollmentId { get; set; } public virtual string Name {…
-
2
votes1
answer258
viewsId pass to new MVC 4 controller
Continuing the previous topic (User add date to List MVC 4) I have a new question. You can see in this topic the initial question and the answer that I was given, but I needed to answer it but I am…
-
2
votes1
answer320
viewsRazorpdf2 - The Document has no pages
I’m trying to use the Razorpdf2 to generate the PDF of a view. I put a breakpoint so much on the controller how much in the view and both are running without any error, but after the execution ends…
asp.net-mvcasked 8 years, 6 months ago Juan Sabino 21 -
2
votes1
answer1063
viewsASP.NET MVC Calculate value in a table
I’m developing a record where I’ll have a table with some additional details that should be entered together with the main register. But one of the columns of this table is calculated, which is…
javascript jquery asp.net-mvc asp.net-mvc-5asked 8 years, 7 months ago Pablo Tondolo de Vargas 5,444 -
2
votes1
answer473
viewsUpdate the inline of an html table
How do I update the line index of an html table after removing it ? I explain better I have a table I can add or delete items to add I use an auto increment variable: _contaLinha++: Add items to the…
-
2
votes1
answer269
viewsError generating excel file
When the system runs on the server this error occurs: ERROR: Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error:…
-
2
votes2
answers9692
viewsEntity Framework Query with Inner Join and Where
I am making a query using Inner Join of some tables and a Where with only one condition, but the data is not returned in EF,the same query in Mysql works and returns data. Follows the code: string…
-
2
votes1
answer1093
viewsAllocate search box in standard Bootstrap Navbar
I’m having trouble allocating a search box on bootstrap. I’m trying to allocate it to navbar standard, top right aligned. My intention is that at each screen, I can modify the parameters for the…
-
2
votes2
answers808
viewsSearch Filter
I have an Items entity that relates to the product table and it is already in production and is working perfectly! Now I need to create a search report in which the user can determine through…
-
2
votes1
answer467
viewsAccess another project’s controller in the same Solution
Guys I have 3 projects in the same Solution: Knockdocweb, Kanodockmodels and Knodockapi as shown in the image below: When I compile the project it starts Kanodockweb, but I want to Access a…
-
2
votes1
answer1134
viewsSelectlist with Viewbag
I’m trying to make a SelectList using ViewBag. But when I run my code it shows where the information I’m trying to access is, for example: NomeProjeto.Models.NomeModel I’m using the following code…