DropDownListFor
is the method you can use: check this for more details: http://msdn.microsoft.com/en-us/library/system.web.mvc.html.selectextensions.dropdownlistfor.aspx
I would suggest you Create
<select id="PeopleClass" name="PeopleClass">
<option value="1">Name1</option>
<option value="2">Name2</option>
<option value="3">Name3</option>
</select>
into a IEnumerable<SelectListItem>
and bind it when you render your view with your selected value from database.
// create People class
public class People{
public value {get; set}
public name {get; set}
}
//Create option list for your dropdown
List<People> peopleList=
new List<People>{ new People{ value="1", name ="Name 1"}, new People{ value="2", name ="Name 2"}, new People{ value="3", name ="Name 3"}};
//bind it with ViewData
ViewData["ddl"] = new SelectList(peopleList, "value", "name", valueFromDatabase );
lastly in your view, bind the dropdown list with ViewData["ddl"]
<%=Html.DropDownListFor(model => model.People,(IEnumerable<SelectListItem>)ViewData["ddl"])%>