title: Set the row background color of html table depending on row index
body: <p>I have a GridView where the ItemTempate contains an HTML table. I am trying to set the class of the table row depending on the GridViewRow Index as follows.</p>
  
  <pre><code>&lt;ItemTemplate&gt;
  &lt;table cellpadding="0" cellspacing="0" border="0" width="100%" class="tblAlternate"&gt;
  &lt;tr class="&lt;%#(Container.RowIndex+1)%2==0?"CustomBGColor":"WhiteBGColor"%&gt;"&gt;
                ....                         
  &lt;/tr&gt;
  &lt;/table&gt;
  &lt;/ItemTemplate&gt;  
  </code></pre>
  
  <p>Can anyone suggest how to do this? 
  Thanks.</p>