您的位置:首页 > 其它

MVC中设置为只读

2016-01-19 14:39 281 查看
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" })
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: