<tbody>
@foreach (var item in Model)
{
int count = 1;
<tr>
<td>@count</td>
<td>@item.ProductName</td>
<td>
@Html.ActionLink("Edit", "ProductEdit", new { productId = item.ProductId })
</td>
</tr>
count = count + 1;
}
</tbody>
此代码用于在表中显示产品,序列号为计数,但计数不增加