好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

MVC中HTML控件设为只读readonly_html/css_WEB-ITnose

1.下拉框设为只读试了试用这个有效:

  @Html.DropDownListFor(model => model.SecondDevelopment, (SelectList)ViewBag.swseconddevelopment, new { disabled = "disabled" }) 

2.文本框:
 @Html.TextBoxFor(model => model.ProjectLeaderName, new { @readonly = "readonly" }) 

3.多选框

 @Html.CheckBoxListFor(model => model.ProvideService, (SelectList)ViewBag.swprovideservice,null, new { @readonly = true }) 

4.单选按钮

  @Html.RadioButtonListFor(model => model.NeedApply, (SelectList)ViewBag.swneedapplyornot, null, new { disabled = "disabled" }) 

查看更多关于MVC中HTML控件设为只读readonly_html/css_WEB-ITnose的详细内容...

  阅读:34次