我有一个名为PermanentAddressChk的字段保存在数据库中。显示复选框是和复选框否
我需要为PermanentAddressChk字段显示2个复选框'是'和'否'。
以下代码工作正常,但有没有更好的方法来做到这一点?打开新的想法,欢呼。
<br />@Html.Label("Yes")
@Html.CheckBoxFor(m => m.PermanentAddressChk, htmlAttributes: new { @checked = true })
<br />  @Html.Label("No")
@Html.CheckBoxFor(m => m.PermanentAddressChk, htmlAttributes: new { @checked = false})
所以他们都可以检查?单选按钮用于多选选项,其中只能选择一个选项。 – Fran