禁用属性未显示在Html.Checkbox上

时间:2018-11-06 19:04:57

标签: html razor model-view-controller checkbox

我试图显示但禁用MVC中的复选框(我知道禁用的复选框仍将回传,值为false)。但是,我无法禁用此复选框。

即使直接添加disabled属性,复选框仍保持启用状态。

tableStyle: "table table-striped table-hover",
                fillEmptyRows: false,
                columns: grid.Columns
                    (
                    grid.Column("EnterpriseRxPlanID", canSort: false, format: (item) => Html.CheckBox("EnterpriseRxPlanID", isChecked: (bool)item.IsSelected, htmlAttributes: new { @class = "form-control wp-check-erxpid", disabled = "" }), header: "Select"),

...

我尝试了disabled = "true"@disabled = ""@disabled = true等,并且该属性隐含在页面中。如果我添加一个新类,它将显示出来,因此我知道页面正在正确刷新。

欢迎任何输入,似乎是一个小问题,但我很困惑。

0 个答案:

没有答案