Most voted "asp.net-mvc-5" questions
This tag should be used when the question refers to some features only available in version 5 (currently the latest) of ASP.Net MVC. ASP.NET MVC is an open-source Microsoft framework that implements the Model View Controller architecture standards for web development. Based on ASP.Net, allows software developers to build web applications following the Model View Controller architecture standards.
Learn more…937 questions
Sort by count of
-
0
votes2
answers187
viewsload date time without javascript
I wanted to know if it is possible to send directly from the controller, for example the current date and time of the system without using javascript. Ex: <div class="form-group">…
-
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
answer218
viewsHow to customize error 404 using Httpnotfound?
Follow the code below: Controller: if (id == null) { //Response.StatusCode = 404; return HttpNotFound(); } View: @{ Layout = null; } <h2>Página não encontrada</h2> I added new code web…
asp.net-mvc-5asked 7 years, 9 months ago Matheus Miranda 5,375 -
0
votes1
answer220
viewsEmpty generated migration after Scaffolding
I’m studying ASP.NET MVC5, so I created a model called RelatorioTagModels: public class RelatorioTagModels { [Key] public int TagID { get; set; } [Required] public decimal Tag { get; set; }…
-
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
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
votes1
answer908
viewsHelp to pass an array via Ajax(post) to MVC 5 controller
I have this code that is generated dynamically by javascript. Simulating a grid <tr class="produto"> <td class="info-CodBarras">123</td> <td…
-
0
votes1
answer451
viewsHow to change a Button’s Text property inside a for
I have a question in ASP.NET, I am creating a loop of repetition inside the HTML so that appear 60 buttons, each with a different number in Text, going from 0 to 59, and then I need to take this…
-
0
votes1
answer212
viewsError handling does not work
In the config of my application I deleted the customErrors to make a test of an error that is difficult to replicate. And where must be going the error I put a Try: if (ModelState.IsValid) {…
-
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
answer47
viewsHow to implement w3c bandwidth requests?
The video plays right. However I can’t skip the video time. Example: Skip time from 05:00 to 10:00. It just keeps spinning, and I can’t skip time. I searched on the internet and they say you have to…
html5 asp.net-mvc-5 entity-framework-6 html5-videoasked 7 years, 7 months ago Matheus Miranda 5,375 -
0
votes0
answers313
viewsProblems generating a PDF View using Rotary
I’m trying to learn how to convert a View to PDF format so it can be printed or downloaded by a user. I read some posts and decided to follow the indication of a library called Rotating that seemed…
-
0
votes1
answer40
viewsAction type A is modified by clicking Action type B
Follows code: _Layout: <div class="navbar-collapse collapse"> <li>@Html.ActionLink("Início", "Index", "Home", new { @onmouseover = "this.style.color='#5cb85c';", @onmouseout =…
-
0
votes1
answer657
viewsReport with Rotary mvc
I’m having trouble generating a report on mvc, using the rotary. The problem is that it generates the pdf, as if I have been ignoring the html, it is all without formatting. ob.: for htm formatting,…
-
0
votes0
answers91
viewsSqldep_onchange with Signalr does not work
Follows code: Notificationhub : Hub private readonly static ConnectionMapping<string> _connections = new ConnectionMapping<string>(); public void SendNotification(string who) { foreach…
-
0
votes0
answers31
viewsId not accepting value Asp mvc 5
People I am trying to do a login logic but in a way without using the other technologies of Asp mvc 5 [HttpPost] [ValidateAntiForgeryToken] public ActionResult Cadastro(Fornecedor fornecedo, int? id…
-
0
votes1
answer99
viewsissue of multiple choices in APS MVC 5
I’m developing a project where he’ll have multiple choices. My problem is that I am not able to show only the questions I want, for example when clicking on the questions would appear to the user…
-
0
votes1
answer240
views500 (Internal Server Error) when defining action as [Childactiononly]
I want to block partialview url through url using [ChildActionOnly]. Face problem, follow code: HTML: <li style="cursor:pointer"><a id="button_id">Criar</a></li> JS:…
-
0
votes0
answers192
viewsSave the path to an image in the database using Asp.net MVC 5
I want to select an image and save in the database the image path, because in the sql database the "Image" column is with the type varchar. Could you help me with some examples? I thank you in…
asp.net-mvc-5asked 7 years, 4 months ago Thales Gilberto 1 -
0
votes1
answer59
viewsAfter Login, how to pass value to the view
After logging in, the user is directed to the page Home and on this page, I would like to show a Label with the client code to which the user belongs. So I went to the table AspNetUsers added a…
-
0
votes0
answers79
viewsDropdownlistfor creation with typed view
Good afternoon, everyone, I’m starting my studies in the art of ASP.NET C#. I’m having trouble creating a Dropdownlistfor. Like I’m doing: - I’m using ADO.NET - I have my model Equipment - I have a…
-
0
votes1
answer80
viewsHow to recover parameter from a Controller
After the user logs in, two parameters are passed to Controller Home: case SignInStatus.Success: { //recupera as informações do usuario que corresponda ao usuario e password var user = await…
c# asp.net-mvc-5 parameters asp.net-identityasked 7 years, 4 months ago Thomas Erich Pimentel 3,059 -
0
votes1
answer104
viewsError when using GROUP via LINQ
I’m trying to perform the query below: var query = from s in db.Crm_Analise where s.cliente_CRM == cod_cli group s by s.TAG into g select new { TAG = g.Key, ATUALIZAÇÃO = g.Max(t =>…
-
0
votes1
answer589
viewsSession Timeout MVC 5
I’m trying to implement Timeout Session in an MVC5 application. I have the following string on Web.config: <sessionState mode="InProc" cookieless="true" timeout="15" /> I created the class :…
-
0
votes1
answer403
viewsE_DEFAULT_LOCALE_NOT_DEFINED: Default locale has not been defined. - Globalize
When I type 1 number in input this error appears: E_DEFAULT_LOCALE_NOT_DEFINED: Default locale has not been defined. Imagery: I’ve tried several shapes and nothing. Follow code: Model: public class…
asp.net-mvc-5asked 7 years, 3 months ago Matheus Miranda 5,375 -
0
votes1
answer406
viewsHow to pass the Model to the controller via Jquery
It is possible to pass the filled Model to the controller via jquery, without having to create a variable and populate it with all fields? Example: I have a modal popup that opens a partialview with…
-
0
votes1
answer23
viewsError saving record without choosing category in dropdownlist
Guys I’m having a problem when clicking save with some data filled ends up giving error how could solve. By clicking save from this error This is the controller to create public ActionResult…
-
0
votes1
answer233
viewsUploading files (images) in ASP.net does not send the image
I can’t send images (banners) in my Asp.net application My controller : [HttpPost] [ValidateAntiForgeryToken] [ValidateInput(false)] public ActionResult Save([Bind(Include =…
-
0
votes1
answer3205
viewsOpen modal through Actionresult in MVC
Hello, I’m building a registration page with MVC . NET and I’m having a hard time. I want to validate the filled information, if they are correct, I will follow the application flow but if not, I…
-
0
votes1
answer43
viewsGet link from an image saved in the bd
I am developing an ASP.NET MVC project using c#. I have a page with a facebook share button. The sharing button is already working, however I’m having problems because of the image tag, because it…
-
0
votes1
answer37
viewsVb.net- An Exception of type 'System.Data.Entity.Infrastructure.Dbupdateexception'
I created a delete but when executing the error : An Exception of type 'System.Data.Entity.Infrastructure.Dbupdateexception', I’ve looked for help, but all that appears is for #C, I need a solution…
-
0
votes1
answer171
viewsProblem has no key defined. Define the key for this Entitytype
Tested having problem with relation between Department and Employee tables This returns 2 error: -"Entitytype 'Funcionario' has no key defined. Define the key for this Entitytype." -Employees' is…
-
0
votes1
answer540
viewsLosing Session after Request
Good guys, I have a problem that so far could not solve. It only starts to occur after a ajax request, in which I submit a document and return to url in a json, to be caught in the javascript, be…
-
0
votes0
answers760
viewsASP.NET MVC: Problem when assigning decimal value
Fichaviewmodel.Cs [Required(ErrorMessage = "A altura é obrigatória.")] public decimal Altura { get; set; } fiche.js $("#Altura").mask("9.99"); Fichacontroller.Cs [HttpPost] public ActionResult…
-
0
votes1
answer218
viewsTwo Foreign key in the same EF column
I have a question, I am programming with . NET MVC using the Entity Framework. At the moment I have: class Produto { public int ProdutoId { get; set; } public string Nome { get; set; } public string…
-
0
votes1
answer71
viewsCordova error while running Ajax call
I have a Cordova 7.0.1 application that requests a method from an Asp.Net MVC Web API 4.6 website. When the call is made on the device, Cordova run Andoid, execution of the method returns error. If…
-
0
votes1
answer950
viewsForeign key Entity framework Asp.net mvc
I have My Repair and Repair Table and I’m getting the following msg when I try to update my Migration: "The introduction of the FOREIGN KEY restriction 'Fk_dbo.Fixeddbo.Pecas_pecasid' in the 'Fix…
-
0
votes1
answer102
viewsMVC5 + Entity Framework + Form + Modal
I have an application where there is a central entity and several other auxiliary registers, such as Status, Format, Type, etc. All these auxiliary entities have only 2 fields: Name and Status…
-
0
votes0
answers41
viewsI’m trying to make Scaffold in visual studio with MVC 5 but is giving the following error
I’m trying and makes the following mistake This is the mistake There was an error running the Selected code Generator: 'Unable to Retrieve Metadata for 'iceguara.Models.Member'. Using the same…
-
0
votes1
answer146
viewsSet Value Default @Html.Dropdownlistfor via Json - ASP.NET MVC5
I am making a timekeeping page using ASP.NET MVC5. The user enters the markup data as shown below: However, if any error occurs in the registration of the tag, the controller returns the model to…
asp.net-mvc .net json asp.net asp.net-mvc-5asked 6 years, 9 months ago Wagner Barbosa Do Nascimento 43 -
0
votes1
answer166
viewsProblem with form Ubmit
I’m having trouble trying to make a form Ubmit when my object is null as it is not required. However it is not possible to save with it null. /// Model public class Atividade { public virtual long…
-
0
votes0
answers68
viewsActionresult Create error
I’m with a exception, in the method of creating an object with a foreign key, db.SaveChanges() with the following message: Dbupdateexception was unhandled by user code. [HttpPost]…
-
0
votes1
answer1572
viewsProblem with Mascara Currency and I calculate
I have a function that is called here: $("#valorPrimeiroPedido").focusout(function () { var valor = $("#valorPrimeiroPedido").val(); calcularValorMercadoria(valor); });…
-
0
votes1
answer211
viewsCascade and Composite Dropdownlist MVC
I have one question I have 1 User class and composed by other classes Gender, Course and Semester Ex public int Id { get; set; } public string Nome { get; set; } public Genero Sexo { get; set; } =…
-
0
votes1
answer125
viewsAsp.Net MVC Binding view model with a List
I’m trying to make a Binding of my view, only when the action is called my object filaViewModel comes with the filaViewModel.Validators equal to null. I’ve tried to pass with @Html.Hidden("Code",…
-
0
votes1
answer77
viewsOauth with Dependency Injection
Hello, I’m starting my studies with Oauth, and right away I came across a problem. I created the famous 'Startup' class, and in it I call my predecessor as follows: public partial class Startup {…
-
0
votes1
answer342
viewsHow to identify if the access is internal or external?
I have an application in Asp.mvc that has 3 (three) types of access, 2 internal and 1 external. Internal access is done by LDAP and external access by a user table. No entanto o usuário externo…
javascript c# asp.net-mvc-5 ip access-controlasked 6 years, 6 months ago Danielle Arruda torres 1,191 -
0
votes2
answers910
viewsCall a method every time a Controller is triggered Asp.net mvc
In my project I have a method that creates a menu on the layout page "_Layout.cshtml", for example, in my control HomeController.cs this method remains, and in ActionResult Index() I call this…
-
0
votes0
answers370
viewsMVC Upload Image and send the database
Good evening I’m making an online shop for a discipline and I was wondering if someone could help me create the image upload to the Database. The purpose is to add in the admin page and appear in…
-
0
votes1
answer70
viewsLogoff after editing a User Role
I am working on an Asp.net-mvc project and would like to force the user logoff after editing a role belonging to the user, using Asp.net-Identity public async Task<ActionResult> Edit(string…