@Html.EditorFor怎么设置属性为只读属性

如题所述

第1个回答  2017-06-21
@Html.EditorFor(model => model.Name, new { disabled = "disabled " })
@Html.EditorFor(model => model.Name, new { disabled = "" })
就可以了。本回答被提问者和网友采纳
第2个回答  2018-04-20
@Html.EditorFor(model => model.Num, new { htmlAttributes = new { @class = "form-control", @readonly = "readonly" } })
相似回答