0
我想从剃须刀视图检索到出勤管理员的学生。在一行中,我想访问单选按钮值。而且有很多行。我如何一次访问所有行数据并将其发送给控制器?从窗体检索学生出勤数据到控制器
我的Razor视图是:
<table class="table">
<thead class="thead-inverse">
<tr>
<th>Full Name</th>
<th>Roll No</th>
<th>Status</th>
@* <th>Status</th>*@
</tr>
</thead>
<tbody>
@using (@Html.BeginForm("Save", "Attendance", FormMethod.Post, new { @class = "form-horizontal" }))
{
foreach (var student in Model.Students)
{
<tr>
<td>@student.Name</td>
<td>@student.RollNo</td>
<td>
<div data-toggle="buttons">
<label class="btn btn-success active">
<input type="radio" name="options" id="1" autocomplete="off" checked> Present
</label>
<label class="btn btn-danger">
<input type="radio" name="options" id="2" autocomplete="off" checked> Absent
</label>
<label class="btn btn-primary">
<input type="radio" name="options" id="3" autocomplete="off" checked> On Leave
</label>
<label class="btn btn-warning">
<input type="radio" name="options" id="4" autocomplete="off" checked> Short Leave
</label>
</div>
</td>
</tr>
}
<div class="form-group">
<div class="col-lg-10 col-lg-offset-2">
<button type="submit" class="btn btn-success">Submit</button>
</div>
</div>
}
</tbody>
</table>
我重视我的网页的屏幕截图,让你可以看到我想要达到的目标。