下拉选择后弹出窗口消失了

时间:2011-07-04 09:20:10

标签: asp.net updatepanel asynchronous-postback

<asp:Panel id="container" CssClass="container"  runat="server" style="width:850px">
            <asp:Panel  runat="server" id="header" cssClass="header" >
                <div class="msg">&nbsp;</div>
                <asp:LinkButton ID="LinkButton1" runat="server" CssClass="close" OnClientClick="clearDataKey()" />
            </asp:Panel>

            <div runat="server" id="whatup">
                <asp:Panel ID="Panel2" runat="server" >
                    <uc1:messageBox ID="InfoBox" runat="server" />
                </asp:Panel>
            </div>

            <asp:updatepanel ID="upcsconfirmation" runat="server">
                <ContentTemplate>
            <cc1:ModalPopupExtender ID="popupCS" runat="server"  BehaviorID="popupCS" TargetControlID="btnTargetCS" 
                        PopupControlID="pnlPopupCS" BackgroundCssClass="modalBackground"/>
                    <asp:Button ID="btnTargetCS" runat="server" Text="Button"  cssClass="hide" />
                    <cc1:DragPanelExtender ID="DragPanelExtenderCS" TargetControlID="pnlPopupCS"  runat="server"></cc1:DragPanelExtender>
                    <asp:Panel ID="pnlPopupCS" runat="server" SkinID="modal"></asp:Panel>
                    </ContentTemplate>
            </asp:updatepanel>



            <div class="body" >

                <div class="contentarea" style="height:200px;">

                    <asp:TextBox ID="datakeyholder" runat="server" style="display:none" Enabled="False" />
                    <asp:ObjectDataSource ID="odsCopyCustRequirements" runat="server" InsertMethod="InsertSearchRequirement" 
                        TypeName="SearchRequirementsDataObject" 
                        oninserting="Requirements_Inserting" >
                    </asp:ObjectDataSource>
                    <div style="height: 100%; width: 100%">

                        <div id="Div1" style="float: left; width: 45%; padding-left:10px">


                            <div class="column130">
                                <asp:Label ID="lblSearch1" runat="server" Text="FAST Region:"></asp:Label></div>
                            <asp:UpdatePanel ID="UpnlCust" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="true">
                                <ContentTemplate>
                                    <div class="column130">
                                        <asp:DropDownList ID="ddSearch1" AutoPostBack="true" DataTextField="Name"
                                            OnSelectedIndexChanged="ddSearch_SelectedIndexChanged" DataValueField="id"
                                            runat="server" Width="150px">
                                        </asp:DropDownList>
                                    </div>
                                    <div class="column130">
                                        <asp:Label ID="lblSearch2" runat="server" Text="Owning Office:"></asp:Label></div>
                                    <div class="column130">
                                        <asp:DropDownList ID="ddSearch2" DataTextField="Name" DataValueField="fastid"
                                            runat="server" Width="150px">
                                        </asp:DropDownList>
                                    </div>
                                </ContentTemplate>
                                <Triggers>
                                    <asp:AsyncPostBackTrigger ControlID="ddSearch1" />
                                </Triggers>
                            </asp:UpdatePanel>


 <div class="column">

                        </div> 
                    </div>
                </div>
               </div> 
               <p></p>

1 个答案:

答案 0 :(得分:0)

包含模式弹出扩展器的上部更新面板( upcsconfirmation )应该有UpdateMode = "Conditional" - 否则,从底部更新面板进行的异步回发也会更新其内容,将模态弹出窗口恢复为隐藏状态。

另一种解决问题的方法是在底部更新面板回发时使用服务器端的Show弹出扩展程序方法(例如,您可以将调用popupCS.Show()放入{{1}保持模态弹出窗口打开)。