发布网友 发布时间:2022-04-21 05:26
共3个回答
懂视网 时间:2022-04-21 09:47
1.下拉框设为只读试了试用这个有效:@Html.DropDownListFor(model => model.SecondDevelopment, (SelectList)ViewBag.swseconddevelopment, new { disabled = "disabled" })
@Html.TextBoxFor(model => model.ProjectLeaderName, new { @readonly = "readonly" })
3.多选框
@Html.CheckBoxListFor(model => model.ProvideService, (SelectList)ViewBag.swprovideservice,null, new { @readonly = true })
@Html.RadioButtonListFor(model => model.NeedApply, (SelectList)ViewBag.swneedapplyornot, null, new { disabled = "disabled" })
热心网友 时间:2022-04-21 06:55
EditorFor没法添加属性,你可以添加一个自定义EditorFor模板,或者EditoFor 改成 TextBoxFor就可以添加html属性了热心网友 时间:2022-04-21 08:13
@Html.EditorFor(model => model.CEK, new { @readOnly = "true" },null)追问@Html.EditorFor(model => model.CEK, new { @readOnly = "readOnly" }) 就可以了