发布网友 发布时间:2022-05-13 06:24
共4个回答
懂视网 时间:2022-05-13 10:45
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-05-13 07:53
HTML控件就readonly="readonly"就可以了,如:热心网友 时间:2022-05-13 09:11
上面说的是将html的控件转换成服务器端的控件,然后就可以随意设置只读了热心网友 时间:2022-05-13 10:46
<input type="text" name="input1" readonly="readonly">and<input type="text" name="input2" readonly="true">all right!