raising onclick event from nested imagebutton

M

Mick

Hi (again ^^)
In my ItemDataBound function,
I dynamically create an ImageButton.
I add to it an onclick event.

Anyway, when clicking my imagebutton, I don't raise the onclick event !
Any help will be appreciated ^^

*****
System.Web.UI.WebControls.ImageButton NewImg = new ImageButton();
NewImg.Click +=new ImageClickEventHandler(NewImg_Click);
NewImg.ImageUrl= Request.ApplicationPath + "/" +
dv.Row.ItemArray[3].ToString() ;
MyPlaceHolder.Controls.Add(NewImg);

private void NewImg_Click(object sender, ImageClickEventArgs e)
{
//code
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,990
Messages
2,570,211
Members
46,796
Latest member
SteveBreed

Latest Threads

Top