2016-01-29 36 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; 
} 
相關問題