嗨我有以下代碼,但循環內的if語句會導致語句失敗,請提出任何想法?mvc3 Razor foreach循環問題
@{ var count = 1; }
@foreach (var siteIcon in Model.SiteIconsList)
{
<div class="span2">
<a onclick="updateIcon(@siteIcon.ImageId)" href='#'>
<img class="iconImage" src="data:Image;base64,@(Html.Raw(Convert.ToBase64String(siteIcon.ImageData)))" alt="" />
</a>
</div>
if(count==5){
</div>
<div class="row-fluid">
count=1;
}
}