} @if(item.i % 2 == 0) { } Witho...">
How to do it?
@if(item.i % 2 == 0) { <div class="row"> } @if(item.i % 2 == 0) { </div> }
Without complaining that I hadn't finished the tag and thus thought I hadn't put } at the end of the if statement
}
You need to attach both lines with @: so that the Razor parser doesn't parse the HTML tags.
@:
@if(item.i % 2 == 0) { @:<div class="row"> } @if(item.i % 2 == 0) { @:</div> }
What would I do id this
@(item.i % 2 == 0 ? "<div class='row'>" : "</div>")
I think it will work;)
Hf!