渲染图像:
cshtml
<label>
@Html.DisplayFor(model => @Model.LeaveDetailsList[i].LeaveType)
@Html.EditorFor(model => @Model.LeaveDetailsList[i].IsSelected)
</label>
在浏览器中查看
<label>
Annual Leave
<input class="check-box" data-val="true" data-val-required="The IsSelected field is required." id="LeaveDetailsList_0__IsSelected" name="LeaveDetailsList[0].IsSelected" type="checkbox" value="true" />
<input name="LeaveDetailsList[0].IsSelected" type="hidden" value="false" />
</label>