I have a script like below on my View:
@{int count = 0;}
@foreach (var item in Model)
{
<div >
<div class="col-md-4"><img src="@item.ImageLink" />
@(count = count +1 );
@if(count ==3)
{
@(count = 0);
@Html.Raw("<div class=\"clearfix visible-md\"></div>");
}
</div>
</div>
}
The problem here is : in addition to the imageLink, the output also contain the value of count when it is assigned with value (meaning that it will print some number: 1,2,3,0 - which is value of count in each loop)
How can I resolve it?
Thanks & regards,