Questions tagged as 'asp.net-mvc'

1
answer

ViewData ["ErrorMessage"] does not appear in view

Hello, I'm new to the C # language and would like to know why my ViewData ["ErrorMessage"] does not appear in my view. Controller: ViewData["ErrorMessage"] = "O e-mail digitado já se encontra registrado em nossa base de dados."; return Redir...
asked by 11.09.2015 / 19:29
1
answer

Make queries using the entity framework

Within my repository EF I have the methods, in method ExcluirRegistro I'm passing a StatusRegistro to the database which indicates that this record is being deleted, so in my methods ListarPorId and ListarTodos I'd li...
asked by 17.09.2015 / 20:33
1
answer

Use / Escape @ in CSHTML view

I'm having a jQuery code on the CSHTML page and I'm having trouble validating the email with a regular expression since @ is a Razor command in .NET. How do I resolve this problem? Follow the script: $("#formEsqueceuSenha").submit(fu...
asked by 11.09.2015 / 14:55
3
answers

Validation to verify that the record is being used before deleting

My project's MVC is built into services, controllers, Views, and models. My delete screen works, but when the log is used in other tables it displays this error. The DELETE statement conflicted with the REFERENCE constraint "FK_XYZ". The co...
asked by 19.08.2015 / 21:55
1
answer

A dynamic field for each database record

I have a property called ProductDevelopment where I have several functions and must assign a user to each function. I have an EditorTemplate to return a list of users. I have to dynamically create a field for each function registered in the data...
asked by 18.08.2015 / 17:40
2
answers

Field format for saving time

What field should I use in SQL Server to save a running time? Example: 2Days 23H 47Min 00Sec. If you have an example with Fluent API it will help a lot.     
asked by 23.06.2016 / 04:20
1
answer

Html.BeginForm () Do not submit model, ModelState.IsValid = False

Next I'm with the Html.BeginForm () where the same submits the model but when it goes to the same control it finds the ModelState.IsValid false. Follows Template, Control and BeginForm Model: [Table("TB_Estado")] public class Estado { [Key...
asked by 09.12.2015 / 20:59
1
answer

Passing data from an HTML table to the ASP.NET MVC controller

I am trying to pass data from an HTML table in my view to my Controller. The data in this table is dynamically added. It opens a BootStrap Modal, where the user informs some data, when clicked the button Ok , the data is added to the tabl...
asked by 07.12.2015 / 19:37
2
answers

How to change the name property in @ Html.EditorFor

I have the following class: public class ModelHome { [Required] [Display(Name = "Nome")] public string Nome { get; set; } [Required] [Display(Name = "Email")] public string Email { get; set;...
asked by 04.12.2015 / 15:23
2
answers

Import and read from file

I have an Asp.Net MVC project with Entity Framework 4 and SQL Server, where there is a Action that receives via POST a csv file. Considering memory usage, processing time and resources, or any questions about the database...
asked by 31.05.2016 / 21:39