一个页面中的多个Ajax Collapsers导致关闭

时间:2011-11-08 17:47:52

标签: asp.net .net ajax collapsiblepanelextender

好的,目前我有一个用于“高级搜索”选项的ajax collapser。然后我去添加一个用于导航的顶部栏,用户可以使用ajax collapser显示/隐藏。默认情况下,collapser已打开,搜索已关闭。现在,当我点击打开搜索选项时,它关闭了导航面板..我似乎无法弄清楚为什么会这样做...任何帮助都不仅仅是值得赞赏。

<asp:UpdatePanel ID="upNorth" runat="server">
        <ContentTemplate>
            <asp:Panel ID="pnlNavigation" runat="server" Width="100%">
                    <div style="float:left;">
                        <asp:Menu ID="NavOptions" CssClass="toolbar" runat="server" Orientation="Horizontal" 
                        </asp:Menu>
                    </div>
                    <div style="float:right; margin-right:20px;">
                        <asp:Menu ID="NavActions" CssClass="toolbar" runat="server" Orientation="Horizontal" 
                        </asp:Menu>        
                    </div>          
            </asp:Panel>
            <div id="CollapseBar" runat="server" class="bar"><asp:Image ID="iBar" runat="server" ImageUrl="../img/bar.jpg" /></div>
            <ajaxToolkit:CollapsiblePanelExtender ID="CollapsiblePanelExtender1" runat="Server"
                    TargetControlID="pnlNavigation"
                    CollapsedSize="0"
                    Collapsed="false"
                    ExpandControlID="iBar"
                    CollapseControlID="iBar"
                    AutoCollapse="False"
                    AutoExpand="False"
                    SuppressPostBack="true"
                    ScrollContents="false"
                    ExpandDirection="Vertical"></ajaxToolkit:CollapsiblePanelExtender>
        </ContentTemplate>
    </asp:UpdatePanel>
    <div id="content">
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <Triggers></Triggers>
            <ContentTemplate>
                <table>
                    <tr>
                        <td><asp:TextBox ID="txtSearch" runat="server" /></td>
                        <td><asp:Button ID="btnSearch" runat="server" Text="Buscar" CssClass="buttons" /></td>
                    </tr>
                </table>
            <asp:LinkButton ID="lbShowBusqueda" runat="server" Text="Advanced Options" />
            <asp:Image ID="imgCollapse" runat="server" ImageUrl="../img/down.png" />
            <asp:Panel ID="Panel1" runat="server">
                <table>
                    <tr>
                        <td>Name</td>
                        <td><asp:TextBox ID="txtName" runat="server" /></td>
                        <td>Lastname</td>
                        <td><asp:TextBox ID="txtLastName" runat="server" /></td>
                    </tr>
                </table>
            </asp:Panel>
            <ajaxToolkit:CollapsiblePanelExtender ID="cpe" runat="Server"
                TargetControlID="Panel1"
                CollapsedSize="0"
                Collapsed="True"
                ExpandControlID="lbShowBusqueda"
                CollapseControlID="lbShowBusqueda"
                AutoCollapse="False"
                AutoExpand="False"

                ImageControlID="imgCollapse"
                ExpandedImage="../img/up.png"
                CollapsedImage="../img/down.png"
                ExpandDirection="Vertical"></ajaxToolkit:CollapsiblePanelExtender>
                </ContentTemplate>
            </asp:UpdatePanel>

1 个答案:

答案 0 :(得分:0)

没关系,似乎我必须指定expandsize,所以它保持开放......很奇怪,但它有效..