首页 > 代码库 > MVC4中下拉菜单和单选框的简单设计方法

MVC4中下拉菜单和单选框的简单设计方法

@Html.LabelFor(model => model.Gender)
@Html.DropDownListFor(model => model.Gender, new[] { new SelectListItem() { Text = "女生", Value = "http://www.mamicode.com/女生" }, new SelectListItem() { Text = "男生", Value = "http://www.mamicode.com/男生" }, })
@* @Html.RadioButton("Gender", "男") 帅哥 @Html.RadioButton("Gender", "女") 美女 @Html.RadioButton("Gender", "保密", true) 保密*@
@Html.ValidationMessageFor(model => model.Gender)

MVC4中下拉菜单和单选框的简单设计方法