title: How to dynamically set control IDs inside a repeater template?
body: <p>Here is a perplexing issue I have not seen a good answer to on StackOverflow, although there a couple stabs at it...  I have a situation where I'd like to do this:</p>
  
  <pre><code>&lt;asp:Repeater ID="MyRepeater" runat="server" OnItemDataBound="MyRepeater_ItemDataBound"&gt;
      &lt;ItemTemplate&gt;
          &lt;li id="id?"&gt;
              All the other stuff
          &lt;/li&gt;
      &lt;/ItemTemplate&gt;
  &lt;/asp:Repeater&gt;
  </code></pre>
  
  <p>The question... is how do I get the ID of my &lt;li&gt; elements to be id1, id2, id3, etc., based on the ItemIndex they are bound to?  So far the most... er..."elegant" solution I've come up with is to replace the &lt;li&gt; with an asp:Literal and dump the &lt;li...&gt;' text.  But that just feels... so wrong.  And no, I'm not using ASP.NET 4.0, which I've read will provide this functionality.</p>