如何将Status值设置为0或1,具体取决于选中的Status radiobutton?我将需要此值以使用布尔数据类型保存在数据库表中。谢谢!
@Html.LabelFor(m => m.status)
@Html.RadioButtonFor(m => m.status, "Active", new { Checked = "checked", @style = "margin-left:auto" })
<label class="rbtnlabel">Active</label>
@Html.RadioButtonFor(m => m.status, "Inactive", new { @style = "margin-left:auto" })
<label class="rbtnlabel">Inactive</label>