0

I have a usercontrol.ascx in a aspx page. And in my user control I have a button click event, and I need to open another user control from this button click. Please give me some suggestions on how to achieve this.

Thanks.

Mani Rajan
  • 19
  • 1
  • 6

1 Answers1

0

You can use Visible property. Let's call the user control with the button ucControl1 and the other ucControl2.

// code-behind of ucControl1
protected void Page_Load(object sender, EventArgs e)
{
  if(!IsPostBack)
    ucControl2.Visible = false;
}

protected void btn_Click(object sender, EventArgs e)
{
    ucControl2.Visible = true;
}
Mehmet K
  • 133
  • 3
  • 8