I think you finally need to add an event to your usercontrol,so in your ascx file you should make an event and also accordingly a protected method for raising that event,
Code:
public event EventHandler UserControlClick;
protected void OnUserControlClick(EventArgs e)
{
if(UserControlClick != null)
{
UserControlClick(this, e);
}
}
then in Button1_Click you execute that protected method(for rasing the event),
Code:
private void Button1_Click(object sender, System.EventArgs e)
{
OnUserControlClick(e);
}
then in your ASP.NET page you put your usercontrols and also attach your new delegate to the event,
Code:
//code-behind for your ASP.NET page
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
UserControl1.UserControlClick +=new EventHandler(WebForm1_UserControlClick);
}
private void WebForm1_UserControlClick(object sender, EventArgs e)
{
//set the visible property of the UserControl2 to true
}
HtH.
_____________________________
Mehdi.
software engineering student.
Looking for a good job for summer 2005.