Questions tagged as 'asp.net-mvc'

1
answer

Retrieve the last 5 ids of the Sql Server database using entity framework?

How do I retrieve information from the last 5 Ids of the Sql server database using entity framwork? Controller public class VideoController : Controller { private DBContext db = new DBContext(); // GET: Video public ActionRes...
asked by 03.09.2018 / 14:18
1
answer

Add form to subscribe the newsletter in C #

Live. I'm developing a website in C #, asp.net with visual studio feature. I would like to put a small form where the site viewer places your email to subscribe to a newsletter. I have already researched ways to do this but I have not found any...
asked by 17.05.2018 / 12:44
1
answer

Error message about something that does not exist in the application [closed]

When running my application this message is appearing, but there is no such parameter. Here is the error message: <%@ Application Codebehind="Global.asax.cs" Inherits="AgendaContato.MvcApplication" Language="C#" %> <%@ Application Co...
asked by 06.11.2014 / 20:51
1
answer

How to get value from a property of an action?

How do I get a value of a property of a action ?     
asked by 19.11.2014 / 14:40
1
answer

Parameter error when saving data

I can not save some data, probably the error is in the parameters. My Controller: public ActionResult SalvarMilestone(Milestone milestone, int CodigoProjeto) { //if (ModelState.IsValid) //{ try {...
asked by 20.10.2015 / 02:04
1
answer

Put Validation on Asp Net MVC Identity

I tried to locate this question in the forum and could not find it. I have an MVC Asp Net application that uses to login the Entity Framework with Identity. My client registration works perfectly, but I am not able to validate two fields: Userna...
asked by 22.02.2018 / 03:46
2
answers

How to put a dropdownlist in a cshtml

I need to put a dropdownlist under the following conditions: It will display the City name (City Table), but it will only record the Employee Code. Using this approach, I can mount the DropDownList: Model public class Cidade { [Key...
asked by 10.08.2018 / 01:00
2
answers

Validation required with if ViewModel [duplicate]

I'm trying to validate fields with the ViewModel This is not working: [Display(Name = "Insc. Estadual")] public string InscricaoEstadual { get; set; } [Display(Name = "Inscrição Isento")] public bool InscricaoIsento { get; set; } public I...
asked by 28.09.2018 / 19:48
2
answers

Passing cpf to a javascript function

My field that loads cpf is this: <div class="form-group"> @Html.LabelFor(model => model.cpf, htmlAttributes: new { @class = "control-label col-md-2" }) <div class="col-md-10"> @Html.EditorFor(model => model.cp...
asked by 10.08.2018 / 23:34
2
answers

Create bank automatically with Code First

I'm creating an ASP.NET MVC application with Code First. This system is trade management software. I would separate the information from each company, and not leave everything in the same bank. We initially thought of leaving everything the same...
asked by 22.01.2016 / 12:10