Reputation: 59
How to set default list values for Html.dropdownlistFor(m =>m.fieldname)?
Upvotes: 0
Views: 425
Reputation: 12440
This is how you generally do it:
<%= Html.DropDownListFor(x => x.FieldName, new SelectList(Model.ListOfOptions, "key", "value"), "-- Default Value --")%>
Upvotes: 3