日期:2014-05-17 浏览次数:20996 次
<li><select name="@Model.Sex" >
<option value="0">女</option>
<option value="1">男</option>
</select>
List<SelectListItem> items = new List<SelectListItem>();
items.Add(new SelectListItem { Text = "A", Value = "1" });
items.Add(new SelectListItem { Text = "B", Value = "2", Selected = true});
items.Add(new SelectListItem { Text = "C", Value = "3"});
ViewBag.list = items;
@Html.DropDownList("list",ViewBag.list as SelectList)