How to dynamically bind data to <%Html.Dropdownlist.... in ASP.NET MVC?
1 Answer
Just pass the correct IEnumerable as the typed model or ViewData. Try something like this (out of my head):
<%= Html.DropDownList(string.Empty,
"myDropDownList",
new SelectList((IEnumerable)ViewData["stuff"],
"DescriptionProperty",
"ValueProperty"))
%>
With that drop down list helper in MVC, you do not really "bind" data to it in the way it is done in the old ASP.NET.