选择在下拉列表中更改的项目后,模态弹出扩展器不显示内容

时间:2012-02-20 06:54:58

标签: asp.net ajax

我在网页中有一个下拉框,其中包含autopostback = true和一个模式弹出扩展程序在同一个webp时代..当我更改选择然后打开模态弹出并输入值然后关闭模式弹出窗口..它将当再次打开模式弹出窗口时,不会显示回发和输入的值....如何在关闭modalpopup并再次获得相同值时阻止回发... 请帮忙...我的代码如下:

<asp:DropDownList runat="server" ID="ddlDBANameFormField" AutoPostBack="true" >
    <asp:ListItem Selected="True" Text="Select"></asp:ListItem>
    <asp:ListItem Text="One"></asp:ListItem>
    <asp:ListItem Text="Two"></asp:ListItem>
    <asp:ListItem Text="Three"></asp:ListItem>
</asp:DropDownList>
<div id="tempHotelStatistic">
    <div id="MainHotelStatistic" style="width: 998px;" runat="server">
        <div style="width: 330px; height: 30px; float: left;" id="RoomsRentedAfterAudit"
            runat="server">
            <div style="width: 150px; float: left;">
                <asp:Label ID="lblRoomsRentedAfterAudit" runat="server" Text="After Audit Rooms:"
                    Width="175px" CssClass="label"></asp:Label>
            </div>
            <asp:UpdatePanel UpdateMode="Conditional" runat="server" ID="UpdatePanel3">
                <ContentTemplate>
                    <div style="width: 150px; float: left;">
                        <table>
                            <tr>
                                <td>
                                    <asp:TextBox ID="txtRoomsRentedAfterAudit" runat="server" CssClass="textboxpopup"></asp:TextBox>
                                    <cc1:ModalPopupExtender ID="ModalPopupExtender4" OkControlID="ModalOKButtonRoomsRented"
                                        runat="server" TargetControlID="btnpopupRoomsRented" CancelControlID="btnpopupCancelRoomsRented"
                                        PopupControlID="PanelRoomRented" Drag="true" PopupDragHandleControlID="PopupHeader1" >
                                    </cc1:ModalPopupExtender>
                                </td>
                                <td>
                                    <asp:Button ID="btnpopupRoomsRented" runat="server" Text="...." CssClass="buttonpopup"
                                        Style="color: #333333; margin-left: 0; margin-right: 0; width: 35px;" />
                                </td>
                            </tr>
                        </table>
                    </div>
                    <div id="PanelRoomRented" style="display: none;" class="popupConfirmation">
                        <div class="popup_Container">
                            <div class="popup_Titlebar" id="Div3">
                                <div class="TitlebarLeft">
                                    Reason :
                                </div>
                                <div>
                                    <asp:Button ID="btnpopupCancelRoomsRented" class="TitlebarRight " runat="server" />
                                </div>
                            </div>
                            <div>
                                <table>
                                    <tr>
                                        <td valign="top" height="5px">
                                            &nbsp;
                                        </td>
                                    </tr>
                                    <tr>
                                        <td valign="bottom">
                                            <textarea id="txtRoomsRentedAfterAuditReason" runat="server" rows="20" cols="20"
                                                style="width: 270px; height: 100px;"></textarea>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td valign="top" height="5px">
                                            &nbsp;
                                        </td>
                                    </tr>
                                </table>
                            </div>
                        </div>
                        <div class="popup_Container" align="right">
                            <asp:Button ID="ModalOKButtonRoomsRented" runat="server" Width="60px" Text="OK" CssClass="buttonForPopUp" />
                        </div>
                    </div>
                    <cc1:FilteredTextBoxExtender ID="FilteredTextBoxExtender111" runat="server" FilterType="Custom,Numbers"
                        ValidChars="-" FilterMode="ValidChars" TargetControlID="txtRoomsRentedAfterAudit">
                    </cc1:FilteredTextBoxExtender>
                </ContentTemplate>
                <Triggers>
                    <asp:PostBackTrigger ControlID="btnpopupRoomsRented" />
                </Triggers>
            </asp:UpdatePanel>
        </div>
    </div>
</div>

1 个答案:

答案 0 :(得分:0)

通过为更新面板应用触发器来解决问题,模式弹出窗口位于...

<Triggers>
<asp:PostBackTrigger ControlID="ddlDBANameFormField" />
</Triggers>