6

我在 AjaxToolkit 3.5 中使用 CollapsiblePanelExtender 来显示/隐藏搜索过滤器选项。

我希望在页面首次加载时展开 CollapsiblePanelExtender,!Page.IsPostBack。

之后,我希望折叠 CollapsiblePanelExtender,因为这意味着他们要么提交了一些过滤器选项,要么将转到搜索结果中的另一个页面。无论哪种情况,我都希望 CollapsiblePanelExtender 被折叠。

有没有办法我可以做到这一点?

在按钮提交处理程序的代码隐藏中,我尝试添加:

CollapsiblePanelExtenderID.CollapsedSize = 0 CollapsiblePanelExtenderID.Collapsed = true

但这似乎不起作用。我还将它添加到处理分页的 lv​​Products_PagePropertiesChanging 处理程序中。

4

1 回答 1

6

我又想通了。

我需要添加这个:

    if (!Page.IsPostBack)
    {
        // do something
    }
    else
    {
        cpFilter.Collapsed = true;
        cpFilter.ClientState = "true";
    }

感谢这个链接:http ://www.dotnetcurry.com/ShowArticle.aspx?ID=230&AspxAutoDetectCookieSupport=1

于 2009-01-16T03:53:32.517 回答