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

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

WBOY
WBOY原創
2016-06-24 11:50:001154瀏覽

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