I'm sure I am missing something obvious, but this is driving me nuts! If I specify html options, the value of my dropdownlist doesn't set.
In my controller, I retrieve the options for my dropdownlist with:
ViewData["Coordinator"] = new SelectList(userRepository.GetIdUserList(1), "ID", "Signature",edCenter.Coordinator);
In my view I populate the dropdownlist with:
Html.DropDownList("Coordinator",(IEnumerable) ViewData["Coordinator"], new {style="width:175px"})
The dropdown values are populated perfectly, but the value of the list isn't selected.
However, if I just use:
Html.DropDownList("Coordinator");
Everything works fine.
What is going wrong??