Bind control's ID property to object property
<p>I have the following repeater control, which is bound to collection of DashboardPage objects. DashboardPage has the following properties: <strong>Name, Pagenumber</strong> .</p>

<pre><code>&lt;asp:Repeater ID="reportPages" runat="server"&gt;           
      &lt;ItemTemplate&gt;
        &lt;asp:ImageButton    runat="server" onclick="ImageButton_Click" 
        ImageUrl="&lt;%# GetImagePath(Container.DataItem) %&gt;" 
        onmouseover="&lt;%# GetMouseOverEventString(Container.DataItem) %&gt;"
        onmouseout="&lt;%# GetMouseOutEventString(Container.DataItem) %&gt;"
         /&gt;
      &lt;/ItemTemplate&gt;

      &lt;SeparatorTemplate&gt;
        &amp;nbsp;&amp;nbsp;
      &lt;/SeparatorTemplate&gt;
  &lt;/asp:Repeater&gt;
</code></pre>

<p>I want to bind ImageButton's ID property to Name property of DashboardPage object, something like this</p>

<pre><code>ID="&lt;%# Eval('Name') %&gt;"
</code></pre>

<p>But an exception is thrown:</p>

<blockquote>
  <p>The ID property of a control can only be set using the ID attribute in the tag and a simple value.</p>
</blockquote>

<p>I need the ID property of the image, because I have a client side script which changes the image, using the it's ID. Is there a way around this?</p>

<p>Thanks for replies</p>

<p>Regards
Gagik Kyurkchyan</p>
