参考:1 http://anghoo.blogbus.com/tag/Html.DropDownList/
Control端:
public PartialViewResult SelectShiftView(string id)
{
List<SelectListItem> items = new List<SelectListItem>();
items.Add(new SelectListItem { Text = "所有轮班制度", Value = "all_view" });
items.Add(new SelectListItem { Text = "轮班制度2", Value = "view2" });
this.ViewData["ddlShift"] = items;
this.ViewData["selected"] = "selected ?? 1";
return PartialView();
}
View 端:
<%= Html.DropDownList("ddlShift", ViewData["ddlShift"] as SelectList, "请选择", new { id = "ddlShift" })%>