簡體   English   中英

從一個用戶控件重定向到另一個用戶控件

[英]redirection from one user control to another user control

我在aspx頁面中有一個usercontrol.ascx。 在我的用戶控件中,我有一個按鈕單擊事件,我需要從此按鈕單擊中打開另一個用戶控件。 請給我一些有關如何實現這一點的建議。

謝謝。

您可以使用可見屬性。 讓我們使用按鈕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;
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM