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
answer41
viewsHaving problems with C#Assembly. Does not accept NPOI Updated
I have a question. I am trying to update the NPOI of an application, but it bursts the following error: Failed to export report (description: Unable to load file or Assembly 'NPOI, Version=1.2.3.0,…
-
-1
votes1
answer39
viewsHow to share menu between ASP.net core applications
How to share menu between applications? We have several applications and all have the same menu, example: Home | Beneficiary | Accredited When new item appears we need to replicate in all…
-
-1
votes1
answer31
viewsMessage when net core exception occurs
I have 1 to 1 relationship between company and user but when the user has already registered 1 company and try to register another I want to show a message other than how can I do?…
-
-1
votes1
answer148
viewsPick only one item from an ASP.NET MVC list
How do I pick up only one item from a list? for example: I have a class called Cliente, my client has a collection of Contatos Public class Cliente { public Int Id {get ;set;} public…
asp.net-mvcasked 5 years, 2 months ago Rafael Passos 527 -
-1
votes2
answers129
viewsI can’t call CSS
When I use @Html.Editorfor and call css, it doesn’t come in input when I run, even if I take out new { htmlAttributes } @Html.EditorFor(model => model.Usuario.MATRICULA, new { htmlAttributes =…
-
-1
votes1
answer108
viewsHow to get specific information from Tolistasync
I would like to create a system that prints on the Index page each Post equal to the image below And for this I created a method that searches the last 3 posts, however, I do not know how to print…
-
-1
votes1
answer122
viewsHow to make an error handling for search not found in ASP.NET API?
The return outside the Try-catch block returns me an empty array, but what should I put there to return some error message in the API request status? Removing Ienumerable and switching to an…
-
-1
votes1
answer33
viewsRight Button Print Html generates blank sheet - Asp.net MVC4
Guys, I have a problem where I have an html page. Right-clicking -> Print generates a blank sheet at the end. I have already reduced the html of the page to almost nothing but still generating…
-
-1
votes1
answer23
viewsC#: Number formatting (with dot)
I’m working on ASP.NET Core MVC and C#. I needed to present the number, e.g., (double) 1000, as 1,000, when presently the number is presented as 1000 . The property in the model is as:…
-
-1
votes1
answer371
viewsNullable<Datetime> 01/01/0001
I have a Model field [Column("sdt_dataPagamento")] [Display(Name = "Dt. Pagamento")] [DataType(DataType.Date)] [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:yyyy-MM-dd}")]…
-
-1
votes1
answer259
views"Invalid column name" MVC
I have a table in a DbContext, change her name, update to database and when I run I get redirected to Visual Studio with the following error message: Invalid column name 'Setorid'. Obs:The table…
asp.net-mvcasked 8 years, 5 months ago Felipe Renan 60 -
-1
votes1
answer31
viewsRole Default Value in a dropdown
I have in my index users, each user has a Dropdown with the Roles, when Get does not show the value that is by default in Dropdown Controller: public ActionResult IndexGestor(string roles) { //query…
-
-1
votes1
answer56
viewsHow to update a User Entity that is converted into application?
Code: public int UpdateUser(User usr) { db.Users.Attach(usr.ToApplication()); db.Entry(usr.ToApplication()).State = System.Data.Entity.EntityState.Modified; return db.SaveChanges(); } Error:…
-
-1
votes1
answer318
viewsHow to configure angular routes with Asp. Net Mvc
I created a controller who calls the Index.cshtml and within the Index.cshtml contains the directive <ng-view> that should render the index.html but it doesn’t work. Controller public class…
-
-1
votes1
answer83
viewsDoubt with decimal numbers Asp.net mvc
I have a register, where I have some fields to enter values, but the same only accepting integer number, if add some value with decimal passes zero. Controller [Display(Name = "Valor Multiplicador…
-
-1
votes1
answer372
viewsLocation.href is not transferring me from ASP.NET MVC page
I am making a login screen in ASP.NET MVC. The framework does all the complete processes without errors: goes to the database, queries the login and comes back with an OK (user exists, I can…
-
-1
votes1
answer1783
viewsWebmatrix - CS0103: The name 'Viewbag' does not exist in the current context
Good afternoon! I’m implementing a Web Matrix application. My page is in . cshtml (c# with html). I want to use the Viewbag Class, but I can’t find it in @using System.Web.Mvc; nor elsewhere. I…
-
-1
votes1
answer964
viewsRelationship of two tables MVC C#
How can I make a Lambda query, I have two Permission and Employee tables, where to inform the email of the Employee, he brings me the Employee’s permissions, through the email that I informed. In…
-
-1
votes2
answers50
viewsHow to create a built-in validation screen?
Excuse me if the title is not so explanatory, but the doubt is as follows: I have to do a CRUD and I already managed to do the C and R, but I am doing the page of Update now and the scheme is more…
-
-1
votes3
answers1898
viewsHow to call a Javascript Function inside a Razor?
I am programming in ASP.NET MVC and I have a registration form. I need to check if the date of birth is valid, ie if it is less than today’s date. I have the script but do not know how to call it…
-
-1
votes2
answers137
viewsProblems with ASP.NET MVC
Has anyone ever had a mistake like this? Code of the View Index: @model SPTC.NIE.SPG.Application.ViewModels.UsuarioViewModel @{ ViewBag.Title = "Index"; } <h2>Index</h2> <p>…
asp.net-mvcasked 8 years ago Leandro Rodrigues 59 -
-1
votes2
answers96
viewsOnly allows 5 attempts at key duplication Entityframework? a 6 badge in Savechange()
Key duplication in write with Entityframework in competition with many users only allows 5 attempts and 6 badge in Savechange() (example 1). If it is with Sqlconnection it does not give any problem…
asp.net-mvc entity-framework vb.net entity-framework-6 competitionasked 7 years, 9 months ago DIT 9 -
-1
votes1
answer1524
viewsPassing data to another page
I need your help, I have two forms, Form 1 Form 2 in the Formulario 1 i have a date field, when filling out this date field I want it to copy to the Formulario 2 without me having to type, it is…
-
-1
votes1
answer424
viewsReturn Controller Image and Render to an HTML Tag Using Javascript/Jquery
I need to render an image returned from a controller to display it to users. I believe that this my code, is very close to the final result, but I can not achieve this final result, always is…
-
-1
votes1
answer208
viewsWrite to BD without mask applied by jQuery
I am doing a project in MVC and with the use of jQuery I made CPF mask as below: $(document).ready(function() { $(".cpf").mask("999.999.999-99"); $(".cpf").addClass("form-control"); }); Follow my…
-
-1
votes1
answer154
viewsType varbinary sql server attribute with c#
That column DocumentoPDF until now it was not used by the: I mean I was always null, however at some point added values and then error occurred in my query linq and the problem is that at the moment…
-
-1
votes1
answer90
viewsHow to Register a Date in My Database using ASP.NET MVC
Let’s assume that I want to register an item in my database.knowing my item name and price. But I also want when registering the item should also register the date.How do I do this? I’m still new to…
asp.net-mvcasked 7 years, 4 months ago Gladiador 345 -
-1
votes1
answer252
viewsSelect particular view for view - ASP. NET MVC
I am learning the ASP.NET MVC and I came across a situation that would like your help. I have a view that shows the result of a database query on the screen. Each record shown has an identification…
-
-1
votes1
answer47
viewsModal passing data null
When saving to my modal the Controller receives Null. 1 - Modal model @model WebAutenticado.Models.CAD_DEVP @{ Layout = "~/Views/Shared/_LayoutModal.cshtml"; } @using (Html.BeginForm()) {…
-
-1
votes2
answers198
viewsHow to walk a C#class?
I have the DeserializeObject that fills in an order class and items, on the items I need to go through this class to record the data, the way I’m doing is zeroing the records, how I could read the…
-
-1
votes1
answer437
viewsReturn two models in a view (foreach)
good morning. I’m new to C# and Asp . net and I ran into a problem. Developing a virtual calendar, I would like to display two queries on a page just when the user logs in, however, there in my…
-
-1
votes1
answer37
viewsFlag environment when sending email to user
Guys, I need your help. Each form that is registered in my system it sends in e-mail to some people warning that it has been registered, except that I have two environments, one of homologation and…
-
-1
votes1
answer162
viewsKaspersky Anti-virus Blocking Modal Bootstrap
My blocking Antivirus when opening modal, the modal is not even displayed right. Follows code: Click event: $("#cartoes_click").click(function () {…
-
-1
votes1
answer1906
viewsError: The model item passed into the Dictionary is of type X but this Dictionary requires a model item of type Y
Error starting query and generating list with results: Error: System.Invalidoperationexception: The model item passed into the Dictionary is of type…
-
-1
votes1
answer68
viewsStrange error on Xlworkbook line
Personal I appeared this message in my code that I am posting in the image, someone can help me in search of a solution; Follows the code: protected void importar_Click(object sender, EventArgs e) {…
-
-1
votes1
answer74
viewsPass a view’s value to modal
Starting my studies in MVC I am doing a CD registration. I happen to have a view with artist details (Artists/Details/1). In this View, I have a "New" button to type a new artist CD and that opens a…
-
-1
votes1
answer470
viewsViewbag, passing controller value to Razor page
I have this Ajax to be able to take the data and pass to the function Save items that is in the Schedulesitenscontroller, that even works perfectly. function SalvarItens() { var idItem =…
-
-1
votes1
answer244
viewsHtml and Css back a row in the table
There’s a For that goes line by line a list. This list returns me input and output of a process. The problem is that it does not return in the same row because it is either input or output. I would…
-
-1
votes1
answer29
viewsLINQ query for object with a sub-list
I have the following structure: public class Insumo{ public int Insumo_id { get; set; } public List<InsumoDados> Dados{ get; set; } } public class InsumoDados{ public int Desc { get; set; }…
-
-1
votes1
answer25
viewsAPS.NET MVC - BD data split
I need to do a function in VB which allows to list in a Dropdown the data of a field in the database. I have to list the data from the 'Eixox' field (in the figure above) in the Dropdown. The doubt…
-
-1
votes2
answers68
viewsProblem deleting a record, fetching the next
I am trying to do in the code, a page edit, then the user on this page edit, he can delete the record, and if he delete, the system has to check, if there is a record next, it goes to edit screen…
-
-1
votes1
answer35
viewsShow a fk name on the grid
This is the select of my proc select f.id ,f.nome ,f.dataNascimento ,f.cpf ,f.cidade ,c.nome from funcionarios f inner join cidade c on f.cidade = c.id and my model cidae is like this public class…
-
-1
votes1
answer48
viewsEdit screen does not load data on screen
When entering edit mode, the Dits should be filled in and only the city dropdownlist comes. See cshtml below. @model TreinamentoCrud.FuncViewModel.FuncionarioViewModel @{ ViewBag.Title = "EditVM"; }…
-
-1
votes1
answer33
viewsMethod/Algorithm for fetching an ASP.NET MVC date
I have the following problem: I’m trying to get a date. I just can’t figure out an algorithm for this. I have a class called RequisicaoDeVeiculo, this class has the attribute DataEHoraDoServico, and…
-
-1
votes1
answer109
viewsChange date display format in View
I have the following field that returns me the date as follows: 09/17/2018 11:52 AM How to put it inside the standard en. I have tried to put the .ToString("dd/MM//yyyy") in the model.dtProtoclo but…
-
-1
votes1
answer210
viewsAlign controls with bootstrap
I have this view @{ ViewBag.Title = "ExcelFinancing"; Layout = "~/Views/Shared/_Layout.cshtml"; } <!DOCTYPE html> <html lang="pt-br"> <head> <meta name="viewport"…
-
-1
votes2
answers124
viewsHow to verify that the email is already registered in the database?
The Controller is always returning the error message, when the email is registered or not in the database. [HttpPost] [ValidateAntiForgeryToken] public ActionResult Create([Bind(Include =…
-
-1
votes1
answer85
viewsViewbag does not receive the value correctly
I’m trying to pass a figure on Controller for View, here is how it is in the View: <div class="alert alert-danger alert-dismissable" role="alert" id="alerta"> <button type="button"…
-
-1
votes1
answer113
viewsHow to re-order a Viewbag, inside the View?
I’m trying to get a Viewbag that received a list in the controller, be reordered after changing a combobox without the page being reloaded. Passing the List to Viewbag: public ActionResult…
-
-1
votes1
answer45
viewsServer.Mappath does not find the folder in my project
I am trying to save a file to a folder in my project (In case in Files folder): but gives the following error when entering the action: Controller Code: [HttpPost] [ValidateAntiForgeryToken] public…