title: Event for Dynamically created Controls in ASP.Net
body: <p>I've created an application in which I've created Dynamic Controls on Click Event of a Button. But the dynamically created Control Event will not Fire on Click of it. 
  Below is the Code I've written. </p>
  
  <pre><code>   ImageButton closeImage = new ImageButton();
          closeImage.ID = "ID"+ dr["ID"].ToString();
          closeImage.AlternateText = "Delete";
          closeImage.ImageUrl = "App_Themes/images/CloseButton.png";
          closeImage.Attributes.Add("style", "float:right;cursor:pointer;margin: -19px 1px -10px;");
          closeImage.EnableViewState = true;
          closeImage.CommandName = "Delete";
          closeImage.CommandArgument = dr["ID"].ToString();
          closeImage.Attributes.Add("runat", "server");
          closeImage.OnClientClick = "return confirm('Are you sure you want to remove this');";
          closeImage.Click += new ImageClickEventHandler(this.closeImage_click);
  
  
    protected void closeImage_click(object sender, ImageClickEventArgs e)
  {
      ImageButton ibDel = (ImageButton)sender;
  }
  </code></pre>
  
  <p>The same code work if its placed on Page_Load(). Is there any other Solution to fire the event.</p>