Click here to Skip to main content
15,896,726 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Dear members,

I am using modalpopup extender on one of my page.
i have mentioned modalpopup css and modalpopupbackground,behaviourid

The problem is modalpopup gets displayed properly for first 5 time, as soon as i click it for 6 or more, modalpopup gets displayed behind the main screen,or goes behind the page.
this problem occurs when i continuously open and close modal popup multiple times without performing some other action.

for opening modalpopup i have set linkbuttonname to targetcontrolid and for closing a popup i have
used a cancel button serverside event to close it . Modalpopup1.close()

After doing google, i did mentioned some z-index property to 1 and even tried with 10000+ values, but still the problem persist,

Below is the code

CSS
.modalPopup
{
    background-color: White;
    border: 0;
    vertical-align: top;
    z-index:10001 !important;
}
.modalBackground
{
  background-color: Gray;
    filter: alpha(opacity=70);
    opacity: 0.7px;


}




XML
<asp:UpdatePanel ID="Upnl_SelLineItems" runat="server">
                                                                                            <ContentTemplate>
                                                                                                <asp:LinkButton ID="lnkSelLineItem" runat="server" Text="Basket"></asp:LinkButton>
                                                                                                <asp:Panel ID="pnl_SelLineItem" runat="server" CssClass="modalPopup">
                                                                                                    <table style="border: thin solid #006699;">
                                                                                                        <tr>
                                                                                                            <td style="text-align: center; background-color: #006699; color: #FFFFFF;">
                                                                                                                Selected Line Items
                                                                                                            </td>
                                                                                                        </tr>
                                                                                                        <tr>
                                                                                                            <td align="center">
                                                                                                                <asp:Panel ID="pnl_grdSelLineItem" runat="server" ScrollBars="Auto">
                                                                                                                    <asp:GridView ID="grd_SelLineItem" runat="server" AutoGenerateColumns="false" CssClass="Grid"
                                                                                                                        EmptyDataText="No Line Items Selected">
                                                                                                                        <Columns>
                                                                                                                            <asp:BoundField DataField="JEDate" HeaderText="JE Date" ReadOnly="True" />
                                                                                                                            <asp:BoundField DataField="JENumber" HeaderText="JE No." ReadOnly="True" />
                                                                                                                            <asp:BoundField DataField="DocumentType" HeaderText="Document Type" ReadOnly="True" />
                                                                                                                            <asp:BoundField DataField="FunctionalCurrency" HeaderText="Currency" ReadOnly="True" />
                                                                                                                            <asp:BoundField DataField="FunctionalAmount" HeaderText="Amount" ReadOnly="True" />
                                                                                                                            <asp:BoundField DataField="Description" HeaderText="Description" ReadOnly="True" />
                                                                                                                            <asp:TemplateField Visible="false">
                                                                                                                                <ItemTemplate>
                                                                                                                                    <asp:Label ID="lblauto_id" runat="server" Text='<%#Bind("Auto_Id") %>' Visible="false"></asp:Label>
                                                                                                                                </ItemTemplate>
                                                                                                                            </asp:TemplateField>
                                                                                                                            <asp:BoundField DataField="PeriodStatus" HeaderText="PeriodStatus" />
                                                                                                                            <asp:BoundField DataField="PeriodComment" HeaderText="PeriodComment" />
                                                                                                                        </Columns>
                                                                                                                    </asp:GridView>
                                                                                                                </asp:Panel>
                                                                                                            </td>
                                                                                                        </tr>
                                                                                                        <tr>
                                                                                                            <td valign="top" style="text-align: center">
                                                                                                                <asp:Button ID="btnClose" runat="server" Text="Close" />
                                                                                                            </td>
                                                                                                        </tr>
                                                                                                    </table>
                                                                                                </asp:Panel>
                                                                                                <asp:ModalPopupExtender ID="mpex_SelLineItem" runat="server" TargetControlID="lnkSelLineItem"
                                                                                                    BackgroundCssClass="modalBackground" PopupControlID="pnl_SelLineItem" RepositionMode="RepositionOnWindowResizeAndScroll"
                                                                                                    BehaviorID="B3" DropShadow="true" PopupDragHandleControlID="pnl_SelLineItem">
                                                                                                </asp:ModalPopupExtender>
                                                                                                <asp:HiddenField ID="HiddenField3" runat="server" />
                                                                                            </ContentTemplate>
                                                                                            <Triggers>
                                                                                               <asp:AsyncPostBackTrigger ControlID="btnClose" EventName="Click" />
                                                                                            </Triggers>
                                                                                        </asp:UpdatePanel>



Any suggestions?
Posted
Updated 11-Feb-13 20:31pm
v2
Comments
Richard C Bishop 11-Feb-13 13:36pm    
Use the "Improve question" widget to add the code you have so far on that please.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900