Home > Web Front-end > HTML Tutorial > Set the HTML control in MVC to readonly_html/css_WEB-ITnose

Set the HTML control in MVC to readonly_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:50:00
Original
1220 people have browsed it

1. Set the drop-down box to read-only and try this one. It works:

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

2. Text box:
 @Html.TextBoxFor(model => model.ProjectLeaderName, new { @readonly = "readonly" })
Copy after login

3. Multi-select box

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

4. Radio button

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


source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template