Ok, now I realized that I was wrong with the <text> and this is why :
In Razor, tags must be properly nested. <text></div></text> there is no correct attachment.
The best way to solve your problem: @Alexei Levenkov:
<div class="container-fluid"> <div class="row show-grid"> @foreach (var one in Model.Select((value, index) => new { value, index }).GroupBy(x => x.index / 3)) { <div class="row show-grid"> @foreach (var el in one.Select(x => x.value)) { <div class="one-element col-md-4"> @el.Title </div> } </div> } </div> </div>
But according to this answer , your Html.Raw() approach is good enough.
teo van kot
source share