就好像結束標記未被識別。這是一個用c#編碼的asp.net MVC4應用程序。我不斷收到此解析錯誤。關閉標記時出現ASP.NET分析器錯誤
'/'應用程序中的服務器錯誤。 解析器錯誤 描述:解析服務此請求所需的資源時發生錯誤。請檢查以下特定的分析錯誤詳細信息並適當修改您的源文件。
解析器錯誤消息:「tr」元素未關閉。所有元素都必須是自動關閉或具有匹配的結束標記。
源錯誤:
Line 24: {
Line 25:
Line 26: <tr>
Line 27: <td><a href="/Home/Details/@cr.productID"</a><td/>
Line 28: <td>@cr.productCodes</td>
源文件:/Views/Home/List.cshtml行:26
版本信息:Microsoft .NET Framework版本:4.0.30319; ASP.NET版本:4.0.30319.18449
這是我使用的代碼。
@model pearlssportsshopquickalystmvc.bc.Products[]
@{
ViewBag.Title = "List";
}
<h2>List</h2>
<table>
<thead>
<tr>
<th>productID</th>
<th>productCode</th>
<th>productName</th>
<th>smallImage</th>
<th>largeImage</th>
</tr>
</thead>
<tbody>
@foreach (Products cr in Model)
{
<tr>
<td><a href="/Home/Details/@cr.productID"</a><td/>
<td>@cr.productCodes</td>
<td>@cr.productName</td>
<td>@cr.smallImage</td>
<td>@cr.largeImage</td>
<tr/>
}
</tbody>
</table>
的結束標記是,(注意的位置正斜槓) –