【发布时间】:2017-04-17 09:27:45
【问题描述】:
我有桌子
<table class="table table-hover">
<thead>
<tr>
<th>userid</th>
<th>image</th>
<th>name</th>
<th>family</th>
<th>level</th>
<th>fild</th>
<th>operation</th>
<th>up to next level</th>
</tr>
</thead>
<tbody>
@foreach (var item in StudentFunc.ShowAllStudents(Model.Class))
{
<tr>
<td>@item.studentid</td>
<td>
<img src="~/Image/StudentImage/@item.studntimage" width="60" height="60"/>
</td>
<td>@item.studentname</td>
<td>@item.studentfamily</td>
<td>@item.studentpayename</td>
<td>@item.studentreshtename</td>
<td>
<a onclick="Edit()" class="btn btn-primary click" href="@Url.Action("InsertScore", "Home", new {payeid = @item.PayeID, reshteid = @item.ReshteID, studentiD = @item.studentid, MostamarID = @StudentFunc.ShowStudents(item.studentid).MostamarID})"><span class="glyphicon glyphicon-pencil"><span style="font-family: 'B Titr'; margin-right: 10px;">ثبت نمره</span></span></a>
<a class="btn btn-default" href="@Url.Action("ListofScore", "Home", new {studentid = @item.studentid})"><span class="glyphicon glyphicon-list"><span style="font-family: 'B Titr'; margin-right: 10px;">لیست نمرات</span></span></a>
<a class="btn btn-default" href="@Url.Action("AddAbsent", "Home", new {studentid = @item.studentid})"><span class="glyphicon glyphicon-list"><span style="font-family: 'B Titr'; margin-right: 10px;"> ثبت غیبت</span></span></a>
</td>
<td>@Html.CheckBox("Pass", false)</td>
</tr>
}
</tbody>
</table>
在表中,我为选择用户添加了一个复选框以用于更新级别。现在我如何找到学生选择的内容以及如何发送有关他们的信息以采取行动?
【问题讨论】:
-
不要给负分请指导我
-
你想在这里做什么? - 你生成复选框(表单控件),甚至没有表单 - 你只有一个链接。你想调用什么控制器方法?除了您生成的无效 html 之外,您所有的复选框都只会发送
true或false这将毫无意义。
标签: c# asp.net asp.net-mvc asp.net-mvc-4 c#-4.0