首页  >  文章  >  web前端  >  MVC中HTML控件设为只读readonly_html/css_WEB-ITnose

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

WBOY
WBOY原创
2016-06-24 11:50:001153浏览

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" })


声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn