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
-
3
votes2
answers234
viewsAdding Text Box and Writing to Database. (with C#, entityframework 6.1.3)
I am doing a project in Visual Studio 2013, with Entityframework version 6.1.3, MVC 4.5.0.0 and using Viewmodel. I am programming a page that is called payment condition. The creation page will have…
-
3
votes1
answer887
viewsSending via Formcollection of monetary values
I need to send to a method in Controller, the values filled in the column Payment_value as shown below: By clicking the green button, send via post, the values of the list below that generated the…
-
3
votes2
answers1336
viewsRemove Time in Datetime field
Dear friends, I need to present only the date in a Textboxfor field. I use this HTML Control because I use a Javascript mask that formats the field value at the time of the date input.…
-
3
votes1
answer214
viewsHow to save additional data in the database?
I’m making a user registration, but I’m able to save only the Username and the Password in the database. How can I save the Surname along? Below is my controller with its actions. using…
asp.net-mvc-5asked 8 years, 11 months ago Gean Claiton 31 -
3
votes1
answer95
viewsDoubt when configuring entities relationship
In a hypothesis, I have an entity to register addresses: public class Endereco { [Key] public int EnderecoId { get; set; } public string TipoLogradouro { get; set; } public string Logradouro { get;…
-
3
votes3
answers4226
viewsPersist information using Viewbag?
I have my screen login is to show the name is id of the logged in user on another screen, so I can use this information. In my controller: [HttpPost] public ActionResult Index(TB_USUARIO model) {…
-
3
votes1
answer1173
viewsAsp.net MVC Models Heritage
I am trying to implement a person register where I have the inheritances for legal and physical person, but my saving method is not getting the type of person properly. follows example code…
-
3
votes1
answer158
viewsStore List<Menu> In Memory or Cookie
good afternoon. I have an application that has a whole level of permissions management of access to pages and a number of other settings. Whenever a user authenticates, I assemble a list of all the…
-
3
votes1
answer1159
viewsThere is no Viewdata item of type 'Ienumerable' that has the key
I’m having trouble with the Employee Position that is on a separate Table, when I try to create an employee selecting the position, he error... but if I assign the position in Controller (Ex:…
-
3
votes1
answer186
viewsTrying to pass Controller values to Global.asax.Cs to fill sessions
When I try to pass some value from my controller to the Global.asax the values received in the aggregate are always zero. Controller: public class LoginController : Controller { DataContext db = new…
-
3
votes2
answers646
viewsSort Dropdown with jquery after append
In case the user does not find the desired item in the list of dropdown, it can include a new item, for this I used the function promptof javascript, and then the user enters the name and click on…
-
3
votes1
answer487
viewsValidate Jquery does not work with Toggle Bootstrap
I’m using http://www.bootstraptoggle.com/, a simple toggle of true or false. Here is the code: View: <form id="myform"> @Html.CheckBoxFor(model => model.Permitir, new { id = "toggle1",…
-
3
votes1
answer412
viewsClass attribute with predetermined values
I want to create a class attribute for sex (M or F), that by default one can already select. It is possible to create an array with these values (M and F) already default without having to type, or…
-
3
votes1
answer828
viewsA specified Include path is not Valid. The Entitytype 'Model.User' does not declare a navigation Property with the name 'Connections'
I’m following this example to maintain connection and user information in a database. So I created 2 tables: dbo. User: dbo. Connection: These 2 tables above are very simple. I only created as a…
-
3
votes2
answers553
viewsFill Dropdownlistfor dynamically with Jquery?
I’m trying to fill one DropDownListFor dynamically. This DropDownListFor eh to display the cities of the state, for example: The user chooses the state and in this DropDown the cities of that state…
-
3
votes1
answer375
viewsASP.Net MVC application with Jquery Bootgrid does not load data
I created a very simple application (customer registration) using ASP.Net MVC 5 + Entityframework 6 (codefirst) + Mysql database. Using as main component the Jquery Bootgrid for data handling. It…
-
3
votes1
answer10492
viewsWhen to use Html.Beginform() and why to use it?
I came across the following situation, in one of the views I have a search ground: <form class="navbar-form navbar-right" role="search"> <div class="form-group">…
-
3
votes2
answers1164
viewsHow popular a select with Jquery
I have a registration screen where the user can add or not phone numbers. I am adding fields for entering the phone dynamically, but one of these fields is a select that will bring data from the…
-
3
votes1
answer699
viewsHow to use Viewmodel in MVC 5 C# with Entity Framework?
I’m trying to learn how to use the concept of Viewmodel, so I did a basic project, but I’m having difficulties. I have the following models: Person id guy document Physique id name surname document…
-
3
votes1
answer58
viewsShow fields of an entity in a different View
I have an entity Academic who owns a Professor, I want in the View details of Academic the teacher responsible for it, i.e. Professor that belongs to that Academic. The code I’m already using is…
-
3
votes3
answers900
viewshow to find a string for json
I have a string in json format. In this way: {"IdLead":4186960,"Concessionaria":"Mila - Centro","DadosQualificacao":{"IdEvento":79654,"Qualificacao":1,"Motivo":6,"DescricaoMotivo":"motivo…
-
3
votes1
answer5032
viewsJS or Jquery Decrease image size and not just resize
Is there any way to decrease the size of the photo before uploading? Note: It’s not just resize, because some test I did just resize and did not decrease the photo size. I would like to check if the…
-
3
votes0
answers99
viewsHow do I use the Visual Studio Authentication feature for an ASP.NET MVC project?
Gentlemen, I need an orientation to begin an ASP.NET MVC development project at Visual Studio. It relates to the implementation of the Authentication feature when creating a new ASP.NET project. My…
-
3
votes1
answer182
viewsIndividual and Legal in the same table
Could you help me please ? I am developing a crud for client, where I will leave physical and legal person in the same table, but in case when the user chooses the type of person through a radio…
-
3
votes1
answer123
viewsWhy can’t I hash the password in my Seed method?
I’m trying to use my method seed below to create a user in the database when it is created: protected override void Seed(CodingCraftMod1Ex4AuthMembershipContext context) { string password =…
-
3
votes1
answer98
viewsForm losing model list
I have the following models: Models public class Atividade : BaseEntity { public virtual int Id{ get; set; } public virtual string Descricao{ get; set; } public virtual IList<Anotacao>…
-
3
votes1
answer248
viewsRecord Email and Phone Array in Database with Entity
I need to save an html array of telefones and Emails, in the database, but I’m not sure how to receive such data. Phone and email number can be 0 ou N, as in the image below, one can add as many…
c# asp.net-mvc-5 asp.net-core entity-framework-core .net-coreasked 5 years, 6 months ago Matheus 616 -
3
votes3
answers125
viewsSave or remove accent on a Textareafor
Hello. I have a Textareafor which receives the HTML content, however when saving the data, the accents and special characters are encoded and I have problems later when editing or viewing the data.…
-
3
votes1
answer81
viewsIs it correct to use an object to call a method where it will be the parameter?
I am creating a small project in without Entity Framework and I have a question at the time of passing an object as parameter, it is correct to pass the same object that calls the method as…
-
2
votes1
answer672
viewsHow do I make Html.Labelfor() display an asterisk in required fields?
I want the required fields (properties with the attribute Required) render with an asterisk indicating that it is a required field. public class Foo { [Required] public string Name { get; set; } }…
-
2
votes1
answer324
viewsHow do I get access_token when I log in with Facebook on MVC5?
When I create a project MVC5 the Visual Studio automatically creates a website for me with option to login by Facebook, Google... Just need to enable in the file "Startup.Auth.cs". But he does the…
-
2
votes2
answers5213
viewsConsume web-service in ASP.NET MVC
I need to consume some methods on my page through a web-service. This web-service is in Europe. What is the best way to do it? What are End-Points?
-
2
votes1
answer169
viewsUpdater of a web application Asp.net mvc
I was here thinking of a framework for automatic updating of my web systems in clients, so I thought of using the ClickOnce with some gambetas(technical adaptations). It did not work, it works only…
-
2
votes2
answers2039
viewsValidate fields with html 5 and mvc 5
As I validate fields in CSHTML itself, when I click the button, it validates the fields and if there are fields not filled it remains on the page, displaying a message. See the example fields and…
asp.net-mvc-5asked 10 years, 8 months ago pnet 14,727 -
2
votes2
answers8248
viewsFill fields with json function return with jquery
I have this method in Controller [HttpPost] public JsonResult PreencheEndereco(string _cpf) { AgaxturCmsEntities db = new AgaxturCmsEntities(); try { var Result = (from a in db.TB_CLIENTES where…
-
2
votes2
answers143
viewsFunction with jQuery recording in two tables does not persist in BD
My need is as follows: write to a table, take the generated ID and write to the second table with this ID. As the order is to do this in jQuery, a function has been made (by a colleague). But…
-
2
votes1
answer2497
viewsCkeditor with MVC5 and EF6
I put the Ckeditor in my project. It works fine, but when I click the button Save it returns Essee error: A possibly dangerous Request.Form value has been detected in the client (Content="<p>…
-
2
votes2
answers1142
viewsPlugin to upload multiple images
I have the following classes in my project. Galeria and Fotos I have a ViewModel where I take the data from Galeria and data from Fotos. When doing Submit (normal, not asynchronous Submit) Galeria…
-
2
votes2
answers1437
viewsHow do I catch Id on the return of a Web Api Post?
I have this code on Web Api: [ResponseType(typeof(Menu))] public async Task<IHttpActionResult> PostMenu(Menu menu) { if (!ModelState.IsValid) { return BadRequest(ModelState); }…
-
2
votes1
answer247
viewsHow to use Reflection
How and why to use Reflection? Is it very useful in everyday life? Its use offers some gain for the system itself?
-
2
votes1
answer112
viewsModel with dynamic type properties
I have a select on the bench that brings several items and loads everything into one model. The point is that one of the items, depending on how the select is done, is brought in a different type.…
-
2
votes2
answers174
viewsReceiving code 200 when it should be 404
I created an ASP.NET MVC 5 application by adding the following code snippets: Web.config <system.web> <customErrors mode="On"> <error statusCode="404" redirect="~/Erro/Erro404"/>…
-
2
votes3
answers3089
viewsPublication of MVC 4 site on IIS is giving error
I uploaded my published application to IIS and I can’t see in the browser. Before I was giving error of Forbidden(403) and now of Server Error(404). I’ve never uploaded an MVC site to the IIS. I…
-
2
votes1
answer1027
viewsWhen and how to use the Asp.net web api
I have been studying Asp.net MVC for some time, I have been reading about WebApi but I still can’t understand when and how I can use it. Ex: I have a small news system, where I have a area where is…
-
2
votes1
answer297
viewsError in view when using Displayfor and foreach
I made this html inside my cshtml. I went to do a foreach and it was an error in foreach and also did not recognize modelItem. In the Models folder are my edmx, so T_PDV is a BD entity mapped in…
asp.net-mvc-5asked 10 years, 6 months ago pnet 14,727 -
2
votes1
answer235
viewsCan the automatically generated . mdf database in App_data be used in production?
The automatically generated database within the App_data folder in projects Asp.Net MVC and Web-Api can be used in production or is a test basis only?
-
2
votes1
answer774
viewsHow to check if my user is online Asp.net Identity?
I want to block so he can’t use the same login on multiple machines. So I need to know if he’s online, how do I do it on Asp.net identitty?
-
2
votes1
answer475
viewsASP.NET Identity customize on its own basis
I already have my base ready with the login table, and I didn’t want to change it, so I wonder if it has how to customize it with the tables I already have! and how to do this! Below the mapping of…
-
2
votes1
answer136
viewsAuthentication, email / password and knowing which bank is correct
The idea is a Saas application. Where there will be only 1 single deploy. and customers will be separated by bank Once this is done, there will be a login screen, where login(email)/password is…
-
2
votes2
answers1470
viewsHow to find out if the session has expired?
I need to find out when the session expires, in ASP.Net MVC, so I can show a modal and redirect. How can I do that? There’s something in the httpcontext that I can use?…
asp.net-mvc-5asked 10 years, 3 months ago Junior Dias 741