I have the following code and it is the nightmare that I feared when I saw the razor syntax in the project that got dumped in my lap. It doesn't understand what part is code and what part HTML.
@for (int i = 0; i < Model.Instructor.Classes.Count;i++ )
{
var c = Model.Instructor.Classes[i];
var mod = (i%2);
if (mod==1)
{
<tr>
}
<td>
@c.Subject @c.CatalogNumber - @c.Section
</td>
if (mod==0)
{
</tr>
}
}
I am just trying to do a simple multicolumn table because the list of items is too long on the page.It prints out my if logic as if it were text. If I put a @ in front of it, it gives me a syntax error. It seems there should be a control for this but all the controls I have seen are worried about alt-styles and not the number of columns to put the data.