@Html.DropDownListFor(model => model.Role, new List<SelectListItem> { new SelectListItem { Text = "Engineer", Value = "1"}, new SelectListItem { Text = "Librarian", Value = "2"}, new SelectListItem { Text = "Admin", Value = "3"} } )
SelectList
@HtmlDropdownListFor
selectedValue
public SelectList( IEnumerable items, string dataValueField, string dataTextField, Object selectedValue )
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)