title: Using ASP Container.ItemIndex in C# if statement
body: <p>I've been thrown a problem regarding ASP and C# without any experience in either and on a server that I have limited access to and where I can't see proper error logs. So prepare yourselves for a potentially confusing question :)</p>
  
  <p>We have a loop (an ASP repeater) in a HTML template and a part of the HTML in the template should only be included in the first iteration of the loop. Unfortunately I can't just hide the html for the other iterations, I need to remove it.</p>
  
  <p>So essentially want to do this:</p>
  
  <pre><code>&lt;% if (Container.ItemIndex == 0) { %&gt;
      Lots of HTML here
  &lt;% } %&gt;
  </code></pre>
  
  <p>Problem is this produces an error (and I can't see the logs so I don't know exactly why...). I know the if statement itself works (setting 0 == 0 instead works as an example), and I can get the index normally, just not here.</p>
  
  <p>So the question is, how does one do something like this? Can I access the index in the C# if statement or is there something built into the repeater that I can use?</p>