在ASP.NET MVC Razor引擎我要显示每行中的三个数据条目,我写这篇文章:ASP.NET MVC Razor引擎在每一行显示三个数据?
<table width="100%" border="0" cellspacing="22" cellpadding="0" style="line-height:18px;">
<tr>
<td align="center" valign="top">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
@{
int counter = 0;
foreach (MVCTaranehMah.Models.Folder item in ViewBag.items)
{
counter++;
if(counter%3 == 0)
{
<tr>
}
<td width="205" height="180" align="center" valign="top"><a href="[email protected]" ><img src="@Url.Content(item.thumb)" width="173" height="173" border="0"></a><br />
<p align="center" valign="top" class="header3">@item.title</p>
</td>
@if(counter%3 == 0)
{
</tr>
}
}
}
</tr>
</table>
</td>
</tr>
</table>
但我得到这个错误
代码块缺少结束“}”字符。确保你在这个块中的所有“{”字符都有匹配的“}”字符,并且没有任何“}”字符被解释为标记。
什么问题,我该怎么做这样的事情?
tnx它的工作.. – MHF 2012-04-01 21:37:29