【发布时间】:2020-10-30 10:23:40
【问题描述】:
我想在 nopcommerce 4.3 中默认检查三个选项中的一个单选按钮
这是我的代码,
<div class="col-md-6">
<div class="raw">
<div class="col-md-2">
<div class="radio">
<label>
@Html.RadioButton("LabourChargeUnit", "false", (Model.LabourChargeUnit == "PCS"), new { id = "LabourChargeUnit_PCS"})
@T("Admin.Catalog.Product.Fields.LabourChargeUnit.PCS")
</label>
</div>
</div>
<div class="col-md-2">
<div class="radio">
<label>
@Html.RadioButton("LabourChargeUnit", "false", (Model.LabourChargeUnit == "PER"), new { id = "LabourChargeUnit_PER" })
@T("Admin.Catalog.Product.Fields.LabourChargeUnit.PER")
</label>
</div>
</div>
<div class="col-md-2">
<div class="radio">
<label>
@Html.RadioButton("LabourChargeUnit", "true", (Model.LabourChargeUnit == "GM"), new { id = "LabourChargeUnit_GM" })
@T("Admin.Catalog.Product.Fields.LabourChargeUnit.GM")
</label>
</div>
</div>
</div>
</div>
现在,我尝试了很多方法,例如 new{@checked = "checked"}, true/false, 0/1,但没有奏效。
【问题讨论】:
标签: html asp.net-mvc radio-button nopcommerce checked