0
我已经创建了一个表格,用于为每一行复选一个复选框。 所述显示是由这种方式:MVC4和剃刀:如何恢复选中的框?
@{
ViewBag.Title = "NewInventory";
Layout = "~/Views/Shared/_Layout.cshtml";
}
<h3>Select rooms for new inventory</h3>
@Html.Partial("RoomListInventory")
<h3>Select people to assign to</h3>
@Html.Partial("PersonListInventory")
在“主”视图和局部视图是,即:
<table class="table table-striped">
<thead>
<tr>
<th>
Select
</th>
<th>
User name
</th>
<th>
User role
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<input type="checkbox" value="1">
</td>
<td>
User 1
</td>
<td>
Role 1
</td>
</tr>
[...]
</tbody>
</table>
我的问题是:如何恢复然后,由于该值复选框将是该人的身份,还是对象或无论如何,如何恢复已选择框?
谢谢!