I know I can make a dropdown with a list of SelectedListItem>
and @Html.DropDownList("someID")
and os on..
My question is, what if you had 2 dropdowns, and the second dropdown depended on the selected item from the first dropdown?
How do you populate it? With JS? How would you go about it? Would you change the populate with another list, change the whole dropdown or maybe have a partialview for each dropdown combination, so it's a matter of replacing with the right dropdown.
I have added NetFiddle example. Works here
I would suggest to use jquery
$.getJson()
to fill second dropdown without refresh to page. You can implement like following example.//html
// jquery
//controller