raising a Click or Command event on an ImageButton click control

J

James Tsao

I've created a Custom UserControl that get's passed a handle to an
ImageButton Control.

Can I raise a Click or Command event on the ImageButton from my
UserControl?

//--- Begin Parent Page ---
public class MyPage: System.Web.UI.Page
{
protected ImageButton PictureFolderExplorerOpen;
private MyControl myControl;

private void Page_Load(object sender, System.EventArgs e)
{
myControl.ClickImage = PictureFolderExplorerOpen;
}
}
//--- End Parent Page ---


//--- Begin UserControl ---
public class MyControl : System.Web.UI.UserControl
{
public ImageButton ClickImage;

private void Page_Load(object sender, System.EventArgs e)
{
// FIRE Click/Command EVENT of ClickImage
}
}
//--- End UserControl ---
 

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,992
Messages
2,570,220
Members
46,807
Latest member
ryef

Latest Threads

Top