<%= Html.DropDownList(“Salutation”, (IEnumerable<SelectListItem>)ViewData["Salutation"])%>
We just did not use properties in our viewdata that had the same name as any of the dropdowns , so above example is wrong and it will not select value properly. Instead of this use something like this:
<%= Html.DropDownList(“Salutation”, (IEnumerable<SelectListItem>)ViewData["SalutationList"])%>
And in controller:
ViewData["SalutationList"] = new SelectList(userModel.Salutations, “Value”, “Title”, user.Salutation);
