title: ASP.NET ItemTemplate Container.DataItem
body: <p>I have a Repeater on one of my pages like so:</p>
  
  <pre><code> &lt;asp:Repeater ID="rptrHalls" runat="server" OnItemCommand="Choose_Hall"&gt;
      &lt;ItemTemplate&gt;
          &lt;asp:Button ID="btn&lt;% Container.DataItem %&gt;" runat="server"
          CommandName="&lt;% Container.DataItem %&gt;" Text="&lt;% Container.DataItem %&gt;"
           /&gt;
      &lt;/ItemTemplate&gt;
  &lt;/asp:Repeater&gt;
  </code></pre>
  
  <p>But, when I run it it errors out with the message:</p>
  
  <blockquote>
    <p>'btn&lt;% Container.DataItem %>' is not a valid identifier.</p>
  </blockquote>
  
  <p>I want to append btn to the Container.DataItem value so that I have dynamically assigned control names that are associated with the underlying data item. Any ideas?</p>