title: If statement in repeaters ItemTemplate
body: <p>I'm using an ASP.NET <code>Repeater</code> to display the contents of a <code>&lt;table&gt;</code>. It looks something like this:</p>
  
  <pre><code>&lt;table cellpadding="0" cellspacing="0"&gt;
      &lt;asp:Repeater ID="checkboxList" runat="server" OnItemDataBound="OnCheckboxListItemBound"&gt;
          &lt;ItemTemplate&gt;
              &lt;tr id="itemRow" runat="server"&gt;
                  &lt;td&gt;
                      Some data
                  &lt;/td&gt;
              &lt;/tr&gt;
          &lt;/ItemTemplate&gt;
      &lt;/asp:Repeater&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>It works fine, but i'd like to have an <code>if()</code> statement inside the <code>ItemTemplate</code> so i can conditionally determine if i want to print out a <code>&lt;tr&gt;</code> tag.</p>
  
  <p>So i'd like to have something like this:</p>
  
  <pre><code>&lt;table cellpadding="0" cellspacing="0"&gt;
      &lt;asp:Repeater ID="checkboxList" runat="server" OnItemDataBound="OnCheckboxListItemBound"&gt;
          &lt;ItemTemplate&gt;
  
              &lt;% if ( (CurrentItemCount % 2) == 0 ) { %?&gt;
              &lt;tr id="itemRow" runat="server"&gt;
              &lt;% } %&gt;
                  &lt;td&gt;
                      Some data
                  &lt;/td&gt;
              &lt;% if ( (CurrentItemCount % 2) == 0 ) { %?&gt;
              &lt;/tr&gt;
              &lt;% } %&gt;
          &lt;/ItemTemplate&gt;
      &lt;/asp:Repeater&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>Is there some way i can achieve this?</p>
  
  <p>PS. The <code>CurrentItemCount</code> is just made up. I also need a way to get the current item count inside that <code>if()</code> statement. But i only seem to be able to get it from <code>&lt;%# Container.ItemIndex; %&gt;</code>, which can't be used with an <code>if()</code> statement?</p>