<%=Html.CheckBox("chk1",true) %> 
<%=Html.CheckBox("chk1", new { @class="checkBox"}) %> 
<%=Html.CheckBoxFor(a =>a.IsVaild, new { @class = "checkBox" })%>
 
生成结果:
 
<input checked="checked" id="chk1" name="chk1" type="checkbox" value="true" /><input name="chk1" type="hidden" value="false" />
 
<input class="checkBox" id="chk1" name="chk1" type="checkbox" value="true" /><input name="chk1" type="hidden" value="false" />
 
<input checked="checked" class="checkBox" id="IsVaild" name="IsVaild" type="checkbox" value="true" /><input name="IsVaild" type="hidden" value="false" />
posted on 2015-01-12 12:00  renshen4322  阅读(8837)  评论(0编辑  收藏  举报