我在asp.net mvc中使用razor创建此表:
...some code...
@{
int counter = 0;
foreach (var item in ViewBag.CdrDetail)
{
counter++;
<tr class="success" id=@counter>
<td>@counter</td>
<td>@item.calledCity</td>
<td>@item.Duration</td>
<td>@item.Price</td>
<td>@item.persianDate</td>
<td>@item.perianTime</td>
<td>@item.strDestination</td>
</tr>
}
}
...some code...
并为id:
$('#UL li').click(function (e) {
alert(this.id);
for (i = this.id; i < $("#MaxValue").val() ; i++) {
$('#CDRTABLE .'+i).toggle();
}
});
但是不要切换,我该如何解决这个问题呢?谢谢