2016-01-29 66 views
0

我在aspx页面中有一个usercontrol.ascx。在我的用户控件中,我有一个按钮单击事件,我需要从此按钮单击打开另一个用户控件。请给我一些关于如何实现这一目标的建议。从一个用户控件重定向到另一个用户控件

谢谢。

+0

请分享您的代码,以便我们为您提供帮助。 –

回答

0

您可以使用Visible属性。我们用按钮ucControl1和其他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; 
} 
相关问题