Answers and code snippets from ASP.NET projects (Webforms/MVC/Classic ASP)
<div class="@(record.Index % 2 == 0 ? "even" : "odd")">