This is easier than you think.
create an event in the code-behind of your ASCX.
public event EventHandler ButtonClick;
then trap the click event of your button within the ASCX itself and raise your custom event.
protected void ButtonA_Click(object sender, EventArgs)
{
if(ButtonClick != null)
ButtonClick(this, new EventArgs);
}
Next, on your ASPX page, make sure you've declared the ASCX in the code-behind. Unfortunately this is not like WebControls where the declaration is automatically inserted for you. Remember this is done at the class level.
protected MyControl ucMyControl; // assuming you named it "ucMyControl"
In VB:
Protected WithEvents ucMyControl As MyControl
You then have to wire your event (you can do it in the Page_Load):
ucMyControl.ButtonClick += new EventHandler(ucMyControl_ButtonClick);
In VB:
AddHandler ucMyControl.ButtonClick, AddressOf ucMyControl_ButtonClick
Then finally, create the method:
protected void ucMyControl_ButtonClick(object sender, EventArgs e)
{
// This is where you can make whatever changes you want to your page.
}
I hope this helps - good luck.
Miguel Castro
www.dotnetdude.com