I am looking to create the following HTML structure:
<div id="my-grid" class="isotope">
<div class="myProject-item">....</div>
<div class="myProject-item">....</div>
<div class="myProject-item">....</div>
<div class="myProject-item">....</div>
</div>
Essentially, every 4th row (out of more than 200 rows) with a class of myProject-item should be wrapped in
<div id="my-grid" class="isotope">
This is what I have tried:
@{
var counter = 0;
for (int i = 1; i < 200; i++)
{
counter++;
if (counter % 4 == 0)
{
<text><div id="my-grid" class="isotope"></text>
}
<div class="myProject-item">....</div>
if (counter % 4 == 0)
{
</div> // ***** on this line render breaks ******
}
}
}
Parser Error Message: Encountered end tag "div" with no matching start tag. Are your start/end tags properly balanced?