@{
var count = 0;
foreach (var item in Model)
{
if (count == 0 || count % 4 == 1){ <div class="row"> }
<div class="col-md-3 col-sm-6">
<div class="thumbnail no-border no-padding">
<div class="media">
<a class="media-link" data-gal="prettyPhoto" href="@item.Hinh">
<img src="@item.Hinh" alt="" width="210" height="310" />
<span class="icon-view"><strong><i class="fa fa-eye"></i></strong></span>
</a>
</div>
<div class="caption text-center">
<h4 class="caption-title"><a href="/sanpham/ChiTiet/@item.ID">@item.Ten</a></h4>
<div class="price"><ins>@item.Gia</ins> </div>
<div class="buttons dathang " data-ten="@item.Ten" data-id="@item.ID" data-soluong="1" data-gia="@item.Gia" data-hinh="@item.Hinh">
<a class="btn btn-theme btn-theme-transparent" href="#">Add to Cart</a>
</div>
</div>
</div>
</div>
if( count % 4 == 0 ) { </div> }
count++;
}
}
我要连续四个产品。当我绑定到if条件时,我的最后一个计数和数字不起作用,字母为白色。