How to create a simple dropdownlist by htmlhelper
controller
public ActionResult Index()
{
DataClasses2DataContext db =new DataClasses2DataContext ();
ViewData["value"] = new SelectList(db.droptest.ToList(),"ID","droptest1");
return View();
}
view
<%= Html.DropDownList("value", (IEnumerable<SelectListItem>)ViewData["value"])%>