I am wondering if there's some new helper or method introduced in ASP.NET MVC 5 to implement cascading dropdown lists. I know a way to implement cascading dropdownlist behavior in MVC 3 and MVC 4 that is by using a JSON call
So anyone knows a better way to implement cascading dropdownlists in MVC 5?
No, there are no new helpers or methods in MVC 5 to help.
The Ajax HTML helpers have been largely ignored in the update. There are some things that may help with stuff related to this:
@Html.EditorFor(m => m.FieldName, new { htmlAttributes = new { @class = "form-control" } })
I implemented cascading dropdowns last week and used the tried and true JSON call you mentioned. I like to use this jQuery plugin in conjunction with the Web API v2 with the new attribute routing.
I know that this is an old question but somebody still may find it useful
I was searching for the same thing but din't find anything stable and useful so I ended up implementing it by myself:
Please take a look at Mvc.CascadeDropDown helper that I created. It works with all MVC versions starting from MVC3 and doesn't require any client side libraries(It uses plain vanilla JavaScript).
The usage is very simple:
Hopefully it will be helpful for some of you