I want to loop through each item in my model in my razor view but I want to group all items together. I then want to loop through each group. Imagine I have a table:
<
@{ Layout = null; } Index @{ String[] name = {"Prashant", "Rishabh", "Zaheer", "Pratima", "Rahul"}; int i = 1; while (i <= 5) { foreach(var x in name) { @i. @x i++; }; break; } } O/p- 1. Prashant 2. Rishabh 3. Zaheer 4. Pratima 5. Rahul
@i. @x