有没有办法在局部视图中识别动态 HTML 表格的单元格位置?
动态表:
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<dynamic>" %>
<div>
<table>
<tr>
<th>
Student ID
</th>
<th>
Quarter
</th>
<th>
Subject
</th>
<th>
Section
</th>
</table>
</div>
<div>
<table>
<% if (Model != null)
foreach (var item in Model) { %>
<tr>
<td>
Html.Encode(item.StudentID)
</td>
<td>
Html.Encode(item.Quarter)
</td>
<td>
Html.Encode(item.Subject)
</td>
<td>
Html.Encode(item.Section)
</td>
<%}%>
</table>
</div>
提前致谢