" />
开发者

how can I set a readonly attribute on a strongly typed checkbox?

how can i set a readonly attribute to a strongly typed checkbox? i tried the following:

<%:Html.CheckBoxFor(model => model.Field1, new {@readonly="true" })%>

i cant use开发者_如何学JAVA a disabled property because this is not posted?


You can do it using your custom javascript or jQuery, or you can set it to disabled (it will be readonly, but greyed)

new {@disabled="disabled" }

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜