Striped table rows in ASP.NET MVC (without using jQuery or equivalent)
- by Richard Ev
When using an ASP.NET WebForms ListView control to display data in an HTML table I use the following technique in to "stripe" the table rows:
<ItemTemplate>
<tr class="<%# Container.DisplayIndex % 2 == 0 ? "" : "alternate" %>">
<!-- table cells in here -->
</tr>
</ItemTemplate>
With the…