I need to design a table with alternating row colors. Below is written code but its not working. May be some syntax issue for MVC. Please suggest.
@for (int i = 1; i <= 10; i++)
{
var rowColor = "D9E6C4";
<tr style="background-color:@rowColor;" >
<td>apoorva</td>
</tr>
if (@rowColor.Equals("#ffffff"))
{
rowColor = "#D9E6C4";
}
else
{
rowColor = "#ffffff";
}
}