html - 如何在 nopcommerce 4.3 中设置默认选中单选按钮
问题描述
我想在 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但没有用。
解决方案
@T("帐户.字段.性别.男性")
@T("账户.字段.性别.女性")
推荐阅读
- javascript - Lightbox2 突然无法在 Chrome 中运行
- python - google.cloud 在哪个 python 库中?
- python - 如何使用 pytest 模拟导入的模块
- c# - 使用 Moq 设置直到运行时才知道类型的泛型方法?
- c# - 我怎样才能“终止”一个无效的方法?
- javascript - 传递给“.run”方法的批处理函数没有返回承诺
- sql-server - 如果任何值为空,GROUP BY 是否返回 NULL?
- gremlin - Gremlin 函数在 Javascript 中不存在,但可以在控制台中使用
- typescript - Firebase Cloud Functions Firestore 触发器产生:错误:7 PERMISSION_DENIED:缺少权限或权限不足
- javascript - Turbolinks 禁止为背景图像添加 Javascript 附加类