我有一個名爲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