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

2
answers

How to get the value of the DropDownList Id?

I am working with ASP.NET MVC 5, I am in need of getting the value of Id of Item selected from DropDownList , when I say value I refer to Id not to Descripción . The DropDowList is loaded as follows: Co...
asked by 18.01.2017 / 22:24
2
answers

@ Html.DropDownList () Does not show the selected value of the ViewData ["something"]

I have a SelectListItem and in an element I put Selected = true, but when passing this object to razor in an @ Html.DropDownList () it does not recognize the selected element. This is how I have it in my view Razor @Html.DropDownList(...
asked by 29.05.2017 / 19:36
2
answers

Do not call my json method to load a cascading combo

Good afternoon I have a theme, changing my combo locality does not change the neighborhood, I'm new using ajax, and I do not understand where the problem is. Thank you very much already. The code is as follows: On the controller: [Http...
asked by 27.10.2016 / 19:57
1
answer

I lost the Session variables in asp.net MVC

After having started the session, all the session variables are suddenly deleted. For example, I agree: [HttpPost] public ActionResult Login(MembersViewModels user) { if (ModelState.IsValid) { if (Isvalid(u...
asked by 11.09.2016 / 18:20
2
answers

List Dropdownlist dependent or Married - Visual.Net -MVC

I would like to know how to use dependent Dropdownlist, for example that the CITY depends on the REGION, and that of the COUNTRY. I am currently using this way of working when listing a dropdownlist: In the controller;      Function Update...
asked by 12.07.2016 / 03:14
1
answer

Add assembly reference in asp .net mvc 5

Good Day. I have the following problem: Recently I migrated my web project asp .net mvc 4 to mvc 5 everything came out normal except for this part: @if (Model.nombresAutocompletado.Count > 0) { var empty = Model.nombresAutocompletado...
asked by 02.06.2016 / 17:27
1
answer

How to change Action according to condition in Ajax url?

I have the following sript: $('a[id^=asociar-]').click(function (e) { e.preventDefault(); var params = { id: parseInt($(this).attr('id').substring(8)), proveedorId: $('#proveedorId').val() };...
asked by 07.05.2016 / 04:22
2
answers

Error MVC5: Access-Control-Allow-Origin header is present on the requested resource [closed]

I have an application in MVC 5 that uses a component to validate the session but it is generating this error.    XMLHttpRequest can not load link . No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin ' link '...
asked by 26.07.2016 / 19:53
3
answers

jQuery AJAX take value from a list and pass it to an object

I have the following @Html.DisplayFor , how could I take the ID and pass it to an AJAX object? @Html.DisplayFor(modelItem => item.Regla, new { id = "reglaid" }) <div class="form-group"> <div class="col...
asked by 19.01.2016 / 16:42
1
answer

Unable to convert type 'System.Int32' to type 'System.Object'

I am working with Entity Framework with mvc and on the client side I have implemented a Select2 for this I have created the following model: public class Select2 { public int id { get; set; } public string text { get; set; } public...
asked by 26.12.2018 / 17:15