ViewBag.CategoryList) 20
等效的HTML: <input id="color" name="color" type="radio" value="red" /> Html.RadioButton有一个强类型的对应方法Html.RadioButtonFor 强类型方法不使用名称和值,而是用表达式来标识那些包含有要渲染属性的对象,当用户选择单选按钮时,后面会跟要提交的值: @Html.RadioButtonFor(m => m.GenreId, "1") Rock
@Html.CheckBoxFor(model => model.IsAdmin) @Html.CheckBox("isAdmin", true) Html.RadioButtonFor 和 Html.RadioButton @Html.RadioButtonFor(model => model.Gender, "Male") Male @Html.RadioButton("gender", "Female", true)