各行のチェック ボックスが前に付いたアイテムのリストを表示するテーブルを作成しました。表示はそのように行われます:
@{
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>
私の質問は次のとおりです。チェックボックスの値は人物、オブジェクト、または問題のIDになるため、ボックスが選択された状態で回復する方法は?
ありがとう !