im trying to write out divs every fourth row but im in some kinda zombie mode today that i cant figure it out. it looks like this
<% var count = 0; var totalCount = 0; foreach (var item in Model)
{
count++; totalCount = Model.Count(); %>
<% if (count % 5 == 0 || count == 1) {%>
<div class="row-me">
<%} %>
<div>
<h2>
<%= item.Name %>
</h2>
</div>
<% if (count % 4 == 0 || count == totalCount)
{%>
</div>
<%} %>
<% } %>
i want it to be
<div class="row-me">
<div></div>
<div></div>
<div></div>
<div></div>
</div>
The condition you want is this:
Examples: