码迷,mamicode.com
首页 > Web开发 > 详细

MVC中HTML控件设为只读readonly

时间:2015-01-28 18:05:02      阅读:177      评论:0      收藏:0      [点我收藏+]

标签:html   mvc   控件只读 readonly   c#   

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   mvc   控件只读 readonly   c#   

原文地址:http://blog.csdn.net/woaishuoshihuo/article/details/43231837

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!