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
-
0
votes1
answer30
viewsrecord does not update with EF
I have a bit of a problem, on the screen, I change the value of the field, and when saved, it does not generate the error, and also does not save. The flow follows, as if there were no problem that…
-
0
votes2
answers111
viewsProblem of changing image using Javascript
The idea is to change image after update. I have the following code: <div id="context1" data-toggle="context" data-target="#context-menu1"> <img id="SizeImage1"…
-
0
votes0
answers59
viewsIs my cache being shared by the pages able to leave it per session?
Good morning, you guys, So, I created a class to handle cache, but open the site in the same browser but with different users, one takes the cache from the other. how can I restrict by "session"…
-
0
votes0
answers408
viewsTwo Dropdowlist ASP.NET MVC 5 filter
I would like to make a filter with two DropDownList. In the first filter are filtered the registered Units and in the second the Functions registered in that unit, with their respective Employees.…
-
0
votes1
answer164
viewsProblem using jQuery UI in ASP.NET MVC
I am trying to add the jQuery UI "Autocomplete Combobox" to my ASP.NET MVC project, but it says that the widget function is not a function. jquery-3.1.1.min. js: 2 jQuery.Deferred Exception:…
-
0
votes2
answers160
viewsIcollection<Object> - how to create and use objects within the collection
I am working on a project using MVC5 and Entityframwork 6. I followed a tutorial to create a database from my templates. Example of a model: public class Side { public Side() { } public int ID {…
-
0
votes1
answer88
viewsDatetimepicker considering day as month
I have an inputText that I created for date, it is initially filled with a Datetime of my Model that is populated: @Html.TextBoxFor(model => model.Data, "{0:dd/MM/yyyy}", new { @class =…
-
0
votes0
answers73
viewsAngular http method: 'POST' is not sending the $Scope object
I’m having a problem in the angular http method post, I’ve seen several tips but none works. Follow the code: $scope.cadastrar = function () { $http({ method: 'POST', url:…
-
0
votes1
answer254
viewsModal Bootstrap being closed
I have the following scenario: a link that opens a modal. <head> <meta charset="utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport"…
-
0
votes1
answer174
viewsP:messages duplicating messages Primefaces JSF
Message duplication problems in Primefaces p:messages. In the application I call this method just to insert the message. Follow the code: public class FacesUtil { public static boolean isPostback()…
-
0
votes1
answer1634
viewsOverwrite Bootstrap classes with CSS file
I’m having a hard time overwriting some Bootstrap classes using a CSS file I created. I am using the Bundle to make these changes: public static void RegisterBundles(BundleCollection bundles, bool…
-
0
votes2
answers71
viewsController code is executed but nothing happens
After much research without results I come here to ask you. The project is in MVC 5 using C#. This is the code that calls a MVC controller $('#btnPesquisa').click(function () { var textAPesquisar =…
-
0
votes1
answer96
viewsIgnore fields to be validated using jquery.validate. 1.8.1
I have a project at the company where I am interning and I have had some errors when validating inputs. Use ASP.NET MVC, Razor, and Javascript. When submitting all fields I get an error. Using the…
-
0
votes0
answers89
viewsAsynchronous Action Error (Async)
This action should send an Asynchronous email, all very simple so far, including using the same class in other projects with the same version of MVC. But to my surprise, this project does not run.…
-
0
votes1
answer33
viewsInsert only items in a Dropdownlist that have already been used in the main register?
I would like to insert in the DropDownList only the sectors that have already been used in contact registration. In my ContatosController in the ActionResult in the method Index I did this, but the…
-
0
votes0
answers152
viewsRedirect Page in AJAX Replay in Asp.net Mvc
I’m having problems redirecting a page, in my Ajax Answer, when I am in Firefox in debug mode, I can redirect, without Debug the page only one refresh, I tried other Directs also failed, only works…
-
0
votes0
answers188
viewsHow to customize the HTTP return message/code of an expired/invalid token in Web Api 2 + Owin?
When my token expires and becomes invalid, I get a 404 (Not found) error return, but the truth is it should be a 401 (Unauthorized). The problem is I don’t know how to customize it. I’m using…
-
0
votes2
answers409
viewsPass List to Actionresult
Briefly: I have a screen with a table populated by the list below, where I select the line through checkbox, I need to pass this list to my actionResult. As I do not have a form on this screen I can…
-
0
votes4
answers1392
viewsReturn True or False in jQuery’s Success
< script type = "text/javascript" > $(document).ready(function() { $('#btnEnviarDados').click(function() { var strFomr = $("form").serialize(); $.ajax({ url: $("form").submit(), type: "POST",…
-
0
votes1
answer601
viewsCannot implicitly Convert type list to an Object
Good night, I’m doubting the following mistake: Cannot implicitly Convert type 'System.Collections.Generic.List' to 'ITCore.FlowCredit.Business.Entities.ProdutoAmortizacaoCreditoDiasSearch' The…
-
0
votes1
answer455
viewsPass Viewmodel properties to Controller
I put my table inside a BeginForm passing my controller and my action, but when I give Submit the fields are NULL in the controller, I don’t think this passing the properties of Viewmodel. @model…
-
0
votes0
answers125
viewsData Annotation with Real Values
I have the following model: [Display(Name = "Valor")] [DataType(DataType.Currency)] public decimal Valor { get; set; } View: <div class="form-group"> @Html.LabelFor(m => m.Valor, "Valor",…
-
0
votes2
answers978
viewsList<Model> Actionresult() MVC
Guys, I need you to help me figure out where I’m going wrong and how to fix a little problem. I don’t know much about MVC, but I’m turning around here. I need to pass a Model class as a parameter to…
-
0
votes2
answers471
viewsHow to leave the json of two or more object classes on the same level in Asp.Net MVC
I have 3 classes being Contact, Sector, Unit so I have Contact with one to many relationship with Sector and Unit generating Json with many layers, making it impossible for Jquery Bootgrid to access…
-
0
votes2
answers225
viewsProblems saving a selected item in Dropdownlistfor using a Viewmodel
I’m trying to save a change I try to make by selecting a Category in a Dropdownlistfor. Kind of: I keep following the Debug and the View is sending the selected Category, but I am not able to…
-
0
votes2
answers150
viewsValidation when editing existing registration?
I have the following problem: I am touching the part of controller of my system on the part of editing registrations and it does the following check, if I enter an existing code, it displays a…
-
0
votes1
answer877
viewsShow an image in mvc
Hi, I’d like a hand. I have the following controller to register an image and some fields, and the image property is string: [HttpPost] [ValidateInput(false)] [ValidateAntiForgeryToken] public…
-
0
votes1
answer251
viewsNo route in the route table Matches the supplied values
I have the following route settings: [HttpPost] [Authorize(Roles = "Perfil Administrador, Master")] public ActionResult AlterarHospital(int id, string url) { var rota = url.Split('/').ToArray();…
asp.net-mvcasked 7 years, 8 months ago Leonardo Macedo 743 -
0
votes2
answers71
viewsjQuery Generic Autocomplete Error 404
I’m making a input with Autocomplete function only that when typing it returns in the console with error 404. Follow the code: $(document).ready(function () { $("#ListaNCM").autocomplete({ source:…
-
0
votes1
answer589
viewsSend form parameter to controller via ajax
I have an Index with a form, I need to fill this form and when clicking the Filter button, call the controller using ajax. Index.cshtml @using (Html.BeginForm("ResultadoPesquisa",…
-
0
votes1
answer179
viewsAssociative Table of Companies and Users, Many to Many
I am starting my studies in ASP.NET and I have a certain difficulty to make a link between 2 tables of the type Many to Many. Next I have 2 tables: Company and User, so that a company can own…
-
0
votes0
answers77
viewsValidation Validationsummary in a modal receive Json message
My application has a View Create which is opened through a modal and the Controller which was a Actionresult became a Jsonresult then return Json after the request [Httppost]. The [Required] Field…
-
0
votes0
answers156
viewsError using.js numeral in Asp.Net MVC application
I am trying to convert the table data to the correct monetary value, and I am using the numeral.js, I have the following script @section scripts{ <script…
-
0
votes1
answer38
viewsIf using load
i have the following javascript function: $(document).ready(function () { Eventos(); $('[name="dtd1nrob"]').change(function () { BloquearQuestao(); }); }); function Eventos() {…
-
0
votes1
answer90
viewsAngular post for ASP.MVC
I need to do a POST after a button click, so that this POST activates a method in a MVC controller, was testing as follows: [HttpPost] public void GerarPDF() { string teste = "teste"; } The name of…
-
0
votes1
answer37
viewsseparating information that is in the string type in Angularjs
I have the following code: app.controller("LoginCtrl", function ($scope, LoginAPI) { $scope.doLogin = function (model) { if (model.username === undefined || model.password === undefined) { return…
-
0
votes1
answer4366
viewsThe web server is configured not to list the contents of this directory
My project ran smoothly, when I needed to divide them into Areas. Then all my old controller (which ran perfectly) was migrated to a certain Area. The areas have been mapped and even updated…
-
0
votes2
answers577
viewsPass Token by header to each Angularjs request (Authorization )
I have the file interface-Factory.js which is my factory app.factory('interfaceAPI', function ($http) { var _getInterface = function () { return $http.get("/api/interfaceapi/getall"); }; var…
-
0
votes2
answers428
viewsThe type must be a Reference type in order to use it as Parameter 'Tentity' in the Generic type or method 'Dbset<Tentity>'
I am trying to set up an Enum in ENTITY FRAMEWORK. But I am not succeeding. My Context is like this: public class MoradaWebContext : DbContext { public DbSet<MeuEnum> Status { get; set; } }…
-
0
votes2
answers306
viewsSplit String Html
I have an HTML with the following code: <div class="page"> ...Conteúdo1 </div> <div class="page"> ...Conteúdo2 </div> <div class="page"> ...Conteúdo3 </div> the…
-
0
votes2
answers1230
viewsHTML inside a Stringbuilder
I have an HTML where I’m formatting it inside a StringBuilder, where there are "quotes" I am passing a bar, but it is not opening the correct HTML. public string CorpoPaginaHtml() { StringBuilder…
-
0
votes2
answers1184
viewsHow to read a user-submitted txt file?
I am learning Asp.net MVC and created a simple form: <form> <div class="form-group"> <label for="municipio">Nome do Município:</label> <input type="text"…
asp.net-mvcasked 7 years, 8 months ago Italo Rodrigo 4,344 -
0
votes1
answer773
viewsPagseguro Notification API receiving 403 error
Hello, I am doing the integration of the Pagseguro API in a transparent way and in the test environment (Sandbox), when I make a change in the status of the transaction there in the Pagseguro panel,…
-
0
votes2
answers598
viewsEntity Framework - When editing, "db. Entry(Category) fails. State = Entitystate.Modified;"
I own a "Category" Entity, which contains id, name, created and updated. I am using Code First. This is my model: public class Category { public int CategoryId { get; set; } public string Name {…
-
0
votes1
answer936
viewsLink calling method in Controller - C# MVC
I have a Mysql table that is shown on a page of my project: foreach (var item in Model) { <tr> <td>@Html.DisplayFor(modelItem => item.id)</td>…
-
0
votes0
answers72
viewsValue shown in production other than development
I have an application in ASP.NET MVC with the Entity Framework with an Oracle database, and the same one showing some wrong data, and this happens only in production, in Debug(locally) the data is…
-
0
votes1
answer53
viewsUnsolicited Truncation of Time
I have a model designed to record a time used in a task: public TarefaHoraPendente() { HorasAcumuladas = new TimeSpan(0, 0, 0); Pausada = false; } public int ID { get; set; } [Required(ErrorMessage…
-
0
votes0
answers28
viewsASP.NET MVC project using Entityframework
Guys, a very beginner question, I did an ASP.NET MVC project using the Entityframework, I did using the standard Unitofwork: public class UnitOfWorks : IDisposable { // Context private AgendaContext…
-
0
votes1
answer287
viewsError saving Entity framework
I have a very basic problem, but I must be short of coffee to understand what is happening. I have such an entity: public class Client : BaseEntity<Client> { [Required] public string…
-
0
votes1
answer326
viewsHow to use Validationmessagefor in Dropdownlistfor?
Please, can someone tell me how to use the @Html.Validationmessagefor for a @Html.Dropdownlistfor? Assuming the user has triggered the option to write from the system screen he should inform that…