Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ImageButton Events

Status
Not open for further replies.

stevenk140

Programmer
Nov 20, 2003
34
CA
For some reasons I am not getting an imagebutton event.

I create the image button dynamically :

ImageButton imageButton = new ImageButton();
imageButton.ImageUrl = "../Images/editsm.gif";
e.Item.Cells[ i].Controls.Add(imageButton);
imageButton.Command += new CommandEventHandler(this.btn_Click);

Then I have the function:

private void btn_Click(object sender, CommandEventArgs e)
{
// Break point set here
}

And my code never gets to the break point.

Please help.

Steven
 
Try this:
Code:
imageButton.Click += new System.Web.UI.ImageClickEventHandler(this.btn_Click);
private void btn_Click(object sender, System.Web.UI.ImageClickEventArgs e)
{
   // Break point set here
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top