【问题标题】:redirection from one user control to another user control从一个用户控件重定向到另一个用户控件
【发布时间】:2016-01-29 07:49:03
【问题描述】:

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

谢谢。

【问题讨论】:

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

标签: c# asp.net user-controls response.redirect server.transfer


【解决方案1】:

您可以使用 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;
}

【讨论】:

    猜你喜欢
    • 2015-10-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-06-14
    • 2015-05-22
    • 2011-11-11
    • 1970-01-01
    相关资源
    最近更新 更多