Questions tagged as 'asp.net-mvc-5'

1
answer

Procedures stored in Controller Entity framework

I have a stored procedure that edits a record, the date field is with getdate() , I'm trying to use that procedure in my controller but I get an error.    No argument corresponding to the formal parameter has been given   required a...
asked by 23.06.2017 / 17:17
0
answers

Validations with Data Annotations in the Entity framework do not work

I have a form made in Asp.NET MVC using Entity framework for persistence and using Data Annotations to validate the fields. The problem I have is that the validations do not work, I want to put fields with null value, I want to save the fields a...
asked by 12.06.2017 / 19:01
1
answer

Error saving fields in a form

I have a form made in MVC ASP.NET, using Entity framework for persistence. I try to save the data, but when I click save, Visual Studio throws me an exception in the line ctx.Empleado.Add(em); of the Create action. Then when I click conti...
asked by 30.05.2017 / 18:32
2
answers

MVC4: Object reference not set as an instance of an object

I am currently using MVC4, and from a layout I am calling a PartialView : @Html.Partial("~/Views/PartialView/EditForm.cshtml") And when I run the application for the first time I get this error: With the application UR...
asked by 23.05.2017 / 15:44
1
answer

Error inserting into the BD using EF

I have this model generated by EF public partial class Ventas { public Ventas() { this.Caja = new HashSet<Caja>(); this.VentasLinias = new HashSet<VentasLinias>(); } public string weblogin { get; s...
asked by 27.05.2017 / 17:51
1
answer

Assign the default value to EditorFor, with current team date

Rescue the date with DateTime.Today or something else and assign it to the EditorFor, since the date is a string. <div class="form-group"> @Html.LabelFor(model => model.fecha, htmlAttributes: new { @class...
asked by 01.06.2017 / 05:26
1
answer

Map an object by JSON

I am mapping an object from my controller, I sent it through the GET method by JSON. The object generates it well, check that it brings data. The communication is correct, it works well if I send an empty object or a text, the problem is when I...
asked by 16.05.2017 / 14:30
1
answer

MVC Razor: How can I initialize DependencyResolver.Current.GetServiceEntity?

I comment quickly: for the architecture of the system there is an "easy" way to get to the database to make update and delete, which is through DependencyResolver . Copy code so you have an idea: IEntityService<Persona> servicePersona =...
asked by 15.05.2017 / 17:32
1
answer

asp net mvc5 - resource file for web multi language

I am trying to make my multilanguage project for it I have created the asp net folder "App_LocalResources" and I have added a resource file that is named "clientes.es-ES.resx" Then in the properties I left them as the capture Now I g...
asked by 17.05.2017 / 10:53
1
answer

How to map a checkbox as bool (bit in SQL server)?

I know they always ask for code, but my question is basic. I also know that you can qualify it as "general knowledge" or "subjective response", but although it seems incredible, there are not many topics in Spanish that speak of the subject....
asked by 26.05.2017 / 08:34