Hi,
I am designing the custom control which contains a Panel. Panel header row contains some text, Imagebutton. That text and text for image button is passed through the Properties. For the Image button I need to add the click event when the user clicks on Image button I need to transfer to another page.
How to provide the Click event to Image button and how to fire the click event in custom control?
I can write like this:
public event EventHandler Click
TableCell c=new TableCell();
ImageButton i=new ImageButton();
i.text=//get text from one property.
i.Click += new EventHandler(this.ib_Click);
c.Controls.add(i);
Protected virtual void ib_click(Object sender, EventArgs e)
{
if (Click != null)
{
Click(this, e); //Click is the EventHandler
}
}
This event is not firing.
How to handle the event.
I am designing the custom control which contains a Panel. Panel header row contains some text, Imagebutton. That text and text for image button is passed through the Properties. For the Image button I need to add the click event when the user clicks on Image button I need to transfer to another page.
How to provide the Click event to Image button and how to fire the click event in custom control?
I can write like this:
public event EventHandler Click
TableCell c=new TableCell();
ImageButton i=new ImageButton();
i.text=//get text from one property.
i.Click += new EventHandler(this.ib_Click);
c.Controls.add(i);
Protected virtual void ib_click(Object sender, EventArgs e)
{
if (Click != null)
{
Click(this, e); //Click is the EventHandler
}
}
This event is not firing.
How to handle the event.