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

1
answer

How to know without a "remove" in my driver was rejected because of a foreign key violation?

how to tell the user that a record has not been deleted because it has other entities that inherit its primary key by means of try / catch? try { db.usuarios.Remove(usuario); } catch(?????) { ??????? }     
asked by 17.08.2016 / 23:13
3
answers

Query Variable EntityFramework

I want to bring only some fields of what the consultation brings me, var result = dbContext.Cliente.Include("Contacto.Cliente").ToList(); this brings me the following: "Objects": [ { "IdCliente": 3, "Identificacion": 10, "Nombre":...
asked by 02.09.2016 / 22:34
1
answer

How to send a json to a view with ASP .NET MVC

I have a driver that sends me information to download a file, currently sent json that way public JsonResult GetXML(DownloadModel model) { JavaScriptSerializer serializer = new JavaScriptSerializer(); Dictionary<string, byte[...
asked by 20.08.2016 / 02:01
1
answer

string format in an input that receives value from ajax

I have a textbox, which receives a data by AJAX. @Html.TextBox("CantidadPago", string.Format("{0:C}",0), new{@class = "form-control"}) AJAX $.ajax({ type: 'POST', url: '@Url.Action("CalcularCantidadPag...
asked by 06.10.2016 / 23:18
1
answer

implementation of sweet alert in an @ html.ActionLink

I need my @Html.ActionLink(); to execute a onclick() and then I run the driver that I send as overload this is what I have. @Html.ActionLink("Delete", "DeleteMunicipality", new { id = item.MunicipalityId }, new { @class = "btn bt...
asked by 10.06.2016 / 19:15
2
answers

Pass selected value from DropDownList to modal window asp mvc

I need to pass the selected value of a DropDownList loaded by means of a SelectList to a modal window, for that I am using this line.           @Html.LabelFor(model => model.CompañiaId, htmlAttributes: new { @class = "control-label co...
asked by 01.04.2016 / 06:56
1
answer

Can Bootstrap be used in a form made with Razor in MVC?

I made a form in one of the View of my project, and now I want to apply Bootstrap to give it style, is it possible to do it? I tried it this way but without results: <form class="form-horizontal"> <label>Nombre</label...
asked by 07.03.2016 / 23:14
1
answer

Problems to directly access the indentity tables with web api through the context.?

As I can access the tables directly, it is with the identity that I can access all the procedures as an example: var user = await UserManager.FindByNameAsync(userName); All those methods I use, but I see the need to call the context...
asked by 23.05.2016 / 01:10
1
answer

Error trying to update with ASP.NET MVC5 entity framework

I have the following problem when I try to update the Gender object, it shows me the following error when I do the update, help try { Common.Entities.Gender gender = this.genderRepository.FindGenderId(genderModel.GenderId);...
asked by 04.01.2019 / 14:24
1
answer

Can you use the Visual Studio toolbox controls, such as GridView, UpdatePanel, AjaxControl Toolkit, etc. working with MVC and Razor?

I am working with visual studio 2013 with MVC and razor , but I would like to take advantage of using the visual studio controls, such as gridview , treeview , navigator , etc. I remember that when I work...
asked by 30.01.2016 / 04:08