title: why click event is not working when its created on server
body: <p>I have:</p>
  
  <p>On the client:</p>
  
  <pre><code>&lt;asp:imagebutton id="icon2" runat="server" visible="false" imageurl="images/icon_info.gif" width="16" height="16" imagealign="AbsMiddle" style="cursor:pointer;" alternatetext=""&gt;&lt;/asp:imagebutton&gt; 
  </code></pre>
  
  <p>On the server:</p>
  
  <pre><code>System.Web.UI.WebControls.ImageButton icon2 = (System.Web.UI.WebControls.ImageButton)e.Item.FindControl("icon2");
  icon2.AlternateText = string.Format(Sales.Common.Res.key("basket.message.material.change") + ". ", line.altMaterial, line.materialCode);
  icon2.AlternateText = "";
  icon2.Click += icon2_Click;
  
  public void icon2_Click(object sender, ImageClickEventArgs e)
  {
      //todo
  }
  </code></pre>
  
  <p>But <code>icon2_click</code> is not working when i click this <code>imagebutton</code>.</p>
  
  <p>Why?</p>
  
  <p>I know about <code>onClick</code> on the client, but I should add this event on server because this image is not always clickable.</p>