I'm sure I'm missing something obvious, but it drives me crazy! If I specify the html options, the value of my dropdown will not be set.
In my controller, I retrieve the parameters for my drop-down list:
ViewData ["Coordinator"] = new SelectList (userRepository.GetIdUserList (1),
"ID", "Signature", edCenter.Coordinator); In my opinion, I am filling out a drop down list:
Html.DropDownList ("Coordinator", (IEnumerable) ViewData ["Coordinator"],
new {style = "width: 175px"}) The dropdown values โโfill out fine, but no list value is selected.
However, if I just use:
Html.DropDownList ("Coordinator"); Everything works perfectly.
What is going wrong?
Aaron source share