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
votes1
answer674
viewsProblem with javascript method coming from controller by Session
That is the mistake: Uncaught Typeerror: Cannot read Property '0' of Undefined Well, here’s the thing: I do a search on a WS. On the return of this search, I mount an html and play in my view…
-
0
votes1
answer213
viewsCan I add content tables in the same database as Users? ASP.Net Identity
I created an ASP.Net MVC 5, EF 6 project with individual accounts. The database is automatically generated with 5 tables: Aspnetroles Aspnetuserclaim Aspnetuserlogins Aspnetuserroles Aspnetusers Is…
-
0
votes1
answer116
viewsDismember date to load javascript
I have in BD a Datanascimento field, where it is gurdada in YYYY-mm-dd format. I have a javascript function that scans the table by last CPF. If there is registration for the CPF, then it assembles…
-
0
votes1
answer851
viewsUpdating edmx file is not working
Whenever I do: UPDATE MODEL FROM DATABASE on top of my edmx file, it does everything right, including shows the table to be updated or the fields. It doesn’t make any mistakes, it acts as if…
-
0
votes1
answer69
viewsDownload content from Session in a class
I have a website that works like this. It has 6 steps. Routes, Air, Hotels, Services, Summary and Payment. Every step of this, I record in a Sesssion. After choosing each product on Session, another…
asp.net-mvc-5asked 10 years, 7 months ago pnet 14,727 -
0
votes1
answer117
viewsProblems with references and MVC
I have a project where it works. I needed to create another project in another place and I took advantage of what I already have. It turns out you’re making a mistake on the basis.Initialize(...)…
asp.net-mvc-5asked 10 years, 7 months ago pnet 14,727 -
0
votes1
answer142
viewsLoad var into jquery with data from BD by Controller
To var str has script with fixed values. How do I get these values to be loaded from a BD through a controller? I already have the method that brings me this. var str = ""; var data = [];…
-
0
votes3
answers238
viewsFooter does not position at the bottom of the page
My css: #rodape { position:absolute; bottom: 0; } .RodapeFaleConosco { float:right; } .RodapeTermoPolitica { float: left; } Now my code in jquery to load html str += '<div id="rodape">'; str…
-
0
votes2
answers210
viewsProblems with the presentation of cshtml(Visual)
I have a cshtml, which is shown like this: A sequence of filters that are fixed. When I click search, then I get the return of a method in the controller via json by a jquery function and in the…
-
0
votes1
answer58
viewsSave information from tabs
I have my canvas, as follows: each tab corresponds to a class, and database entity, and going in sequence there is a reference to them, ie na 02 tem referencia(fk) da 01, na 03 tem referencia(fk) 02…
-
0
votes1
answer188
viewsVisual Studio keeps giving error in the ASP.NET MVC 5 project
Hello, I’m trying to open an ASP.NET MVC 5 project and is giving the following error: Can someone help me? I already installed the updates and MVC 5. I installed the web pages through Nuget:…
-
0
votes1
answer139
viewsInterface does not recognize class type even with declared DLL
I created a Class Library project and in it a POCO class. I created an Interface (all following John Sharp’s book). Then I created my WS with WCF. Well, in the interface I declared a method of my…
-
0
votes1
answer231
viewsMap Id of one model to another without a Dropdownlist
I had a problem making relationships in my application. my project is from a school, and in it I have to have the occurrences. But when it comes to relating the Student to the Occurrence happened to…
-
0
votes2
answers197
viewsError making an insert in the database
I am trying to save some data in the database and am getting this error: The INSERT statement conflicted with the FOREIGN KEY Constraint "Fk_dbo.Occurrences_dbo.Alunoes_alunoid". The Conflict…
-
0
votes1
answer817
viewsDifficulty placing checkbox in treeview with or without bootstrap
This is my treeview: @*Daqui para baixo, tudo se relaciona com a treeview*@ <div class="well" style="width:100%; padding: 8px 0;"> <div style="overflow-y: scroll; overflow-x: hidden;…
-
0
votes1
answer760
viewsJavascript error - Uncaught Typeerror - Unable to resolve
Give me the following error: Uncaught Typeerror: Undefined is not a Function. I still can’t fix it. I’ve already changed jquery versions and nothing. I looked for quote errors, semicolon and still…
-
0
votes3
answers647
viewsDynamically load from the bank and mount a treeview in cshtml I’m not getting
is as follows. I am not getting satisfactory results in assembling a tree using checkbox as in a treeview. Well, when I put the fixed data works very well. But when I bring the BD data, that’s where…
-
0
votes2
answers982
viewsHow to redirect to another page when user does not have authorization
I have my Custom AuthorizeAttribute. It works perfectly the way I want, but it always directs the user to /Account/Login, I would like you to redirect to another page that I choose, since it has no…
-
0
votes1
answer1215
views'Object' does not contain a definition for 'Action'
I am using MVC 5 with Identity to login, appeared this error that so far could not find a solution. Error happens in view _ExternalLoginsListPartial.cshtml…
-
0
votes1
answer194
viewsDate is coming in wrong format
In a jquery function, I get a date in my View. It turns out that the date is coming like this: /Date(1402369200000)/ I know I need to do a cast or something, but I don’t know how to do it. Can…
-
0
votes2
answers1831
viewsChoose color in <input type="Submit"...>
How could I set a color for the input. Below I have one of the input that I use. <input type="submit" id="Submit69" class="btn btn-default btn-block" value="REP+H4" title="Clique Selecionar as…
-
0
votes2
answers558
viewsJquery does not mount date correctly
I did that and MSG is: Invalid Date. I think it’s because everything has turned into a string. How do I bring only the numerical part on the date? In fact, I say this because I cannot return a date…
-
0
votes2
answers792
viewsPosition controls with bootstrap not aligning
I need to do the following: Label above and control below the Abels. I took the example of the page itself twitter bootstrap and it’s not working. Below my code: <div id="tabs-1"> <form…
-
0
votes1
answer70
viewsMethod jQuery is not writing in BD
I have a routine to record in BD. With you in AJAX Success, fire a alert, but does not save. A button that calls the method, passes the parameters to the method in the controller and that method…
-
0
votes1
answer292
viewsPlace tabs inside a form
I have an html document with tabs. That’s ok. Now, inside one of these tabs, I have a form, where I put my controls. I could not put, inside this form more tabs, so that would have a documanto and…
-
0
votes2
answers122
viewsInvalidoperationexception when using the Databasecontext Set method
When using the Dbcontext.Set() method, the following exception is raised: The Entity type is not part of the model for the Current context If I create a Dbset directly in Databasecontext, it works.…
-
0
votes1
answer4278
viewsMy view does not starta
This is the Error that gives: Erro de Servidor no Aplicativo '/'. Não é possível encontrar o recurso. Descrição: HTTP 404. O recurso que você está procurando (ou uma de suas dependências) não pôde…
-
0
votes1
answer278
viewsPlace where methods of interaction of CRUD with the bank in ASP.NET MVC should be
I am using the Entity framework and developing a system through ASP.NET MVC5 but I was in doubt about CRUD. The methods of interaction with the database (Create,Update,Select,Delete) should be…
-
0
votes2
answers87
viewsAdd new Controller
When adding a new Controller in my project using the option MVC 5 Controller with views, using Entity Framework I’m having the error there was an error running the selected code generator, according…
-
0
votes2
answers485
viewsForeach within a cshtml
It is giving error the way I did foreach. If I put @ gives error in parser. If I withdraw gives other errors. How do I do? Below me full code. @model Ruptura.Models.RupturaEntities @{ ViewBag.Title…
-
0
votes0
answers181
viewsKnockoutjs and ASP.NET MVC
So I’m starting to take a look at Knockoutjs and it’s all a little dark yet, in the example I’m following, I’m having a mistake that says O objeto não oferece suporte à propriedade ou método 'join'.…
javascript c# asp.net-mvc asp.net-mvc-5 knockoutjsasked 9 years, 8 months ago Pablo Tondolo de Vargas 5,444 -
0
votes1
answer434
viewsReturning selected data to Razor in anonymous object
I have a controller where I look for the birthday kids of the month. But I have more than 1000 birthday girls per month, returning a table with more than 50 attributes of each one, thus making the…
-
0
votes1
answer115
viewsHow to do Logoff with Ajax?
I have my menu, and it has a dropdown <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">Usuário</a> <ul class="dropdown-menu" role="menu">…
asp.net-mvc-5asked 10 years, 2 months ago Rod 9,412 -
0
votes2
answers1976
viewsHow to pass a variable in a Javascript function by the onclick Razor?
I have a series of fields I need to send from tag Razor for a function JavaScript @Html.ActionLink("Enviar", "ActionName", null, new { onclick = String.Format("envia_pessoa({0}, '{1}', '{2}', '{3}',…
-
0
votes1
answer615
viewsTake Model in View with values from the database
I have that class: public class MontaArvoreAcao { public int IDRuptura { get; set; } public DateTime DataRuptura { get; set; } public int IDMotivo { get; set; } public string Motivo { get; set; }…
-
0
votes1
answer210
viewsNest <ul> tag in another <ul> tag with foreach
I have this foreach, which I did with your help here at SOPT. I cost to make it work, but it worked. Only I did it with just one knot. What I’m going to need is this. I have a father knot, inside…
-
0
votes1
answer278
viewsGrouping in foreach and view does not work
I created and set a variable to control the following. My LINQ returns 5,000 lines today. This variable, it’s there to avoid repeating the same thing, like. Let’s say Linus gives me 400 ID=1 motif.…
-
0
votes1
answer128
viewscontroller responsibility
I have my Model Bank public class Banco { public int Id {get;set;} public string Nome {get;set;} } and my model Contabancaria public class ContaBancaria { public int Id{get;set;} public string Nome…
asp.net-mvc-5asked 10 years, 2 months ago Rod 9,412 -
0
votes1
answer662
viewsLINQ with Left Join and Multiple Keys
My LINQ query does not give error but does not show any result. Where I made a mistake? using (var db = new MyEntities()) { var result = (from dc in db.DiarioClasse join fn in db.Faltas on new {…
-
0
votes2
answers494
viewsSave data group in Post method
I’m using the Begincollectionitem to save a list of data in my add method. For that, I created a ViewModel with the main data to the list I want to save, in the method POST. I own the ViewModel…
-
0
votes1
answer74
viewsDoubt on how to set the type to return a list
I need to return some lists to my view. I am using Viewdata. But there is a problem, when declaring the variable, I do not know what type to put. I did it in the form below and is giving the…
-
0
votes2
answers803
viewsASP.NET MVC 5 runs on IIS 7.5 Windows Server 2008?
I have a website that is developed in ASP.NET Framework 4.5 MVC 5 and is not opening in IIS 7.5 Windows Server 2008, but in IIS Express Local Windows 7 opens normal. Missing something to install on…
-
0
votes1
answer101
viewsPartial is not rendered
Accordingly this link from another question of mine that ended up generating error where I followed the steps referring to another question, I am experiencing a rather strange error. I created a…
-
0
votes1
answer335
viewsScript does not appear when pressing Section
I have a Section called Scripts (the one configured by default): @RenderSection("scripts", required: false) And I’m trying to load the Tinymce Plugin as follows: @section Scripts { <script…
-
0
votes1
answer112
viewsKnowing Modelstate in javascript dynamically
I am developing an application in ASP.NET MVC 5 and I have a problem in putting a charging modal while the form is saved, because when there is something invalid in the form javascript does not…
-
0
votes0
answers57
viewsHow to get a piece of the Asp.net URL mvc5
I have the following URL: http://localhost:59278/video/categoria/desenho I’m trying to use the Url.Action to mount a URL that is based on the value of the current URL. I need to take the amount…
-
0
votes2
answers745
viewsField saves only date and part of time is "zeroed"
I have this part of code in my view. <div class="form-group"> @*@Html.LabelFor(model => model.DT_AGENDAMENTO, htmlAttributes: new { @class = "control-label col-md-2" })*@ @Html.Label("Data…
-
0
votes1
answer71
viewsEdit registered containing image
I have my model: public class Produto { public int Id {get;set;} public string Nome {get;set;} public byte[] Imagem {get;set;} } How do I handle it if it is "Removing" or is Editing(Replacing) the…
asp.net-mvc-5asked 10 years ago Rod 9,412 -
0
votes1
answer493
viewsWhat is the best way to generate pdf files via webservice?
I have a Soap webservice and came across the need to generate pdf documents. Has anyone ever worked with generation of many documents via webservice and what technologies have they used? Which…
-
0
votes1
answer158
viewsGenerate MAC address hash and save to database
According to my question to get the address mac of the network card and generate its hash, the following methods are used: private string GetSHA1HashData(string data) { SHA1 sha1 = SHA1.Create();…