Click here to Skip to main content
15,887,485 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using a ModalPopupExtender to show the session time out countdown alert to user of web application.

My application also has many pop windows on which the user works.

Challenge i am facing is that the session alert shows up on the main browser window i.e. in back of the browser pop up windows. And so the user may not be able to notice the session reset alert.

So how to show the ModalPopupExtender in front of the browser pop up windows ?

Following is the relevant code:

<asp:ModalPopupExtender ID="mpeTimeout" BehaviorID ="mpeTimeout" runat="server" PopupControlID="pnlPopup"
     TargetControlID="lnkFake"
    OkControlID="btnYes" CancelControlID="btnNo" BackgroundCssClass="modalBackground" OnOkScript = "ResetSession()">
</asp:ModalPopupExtender>


<script type="text/javascript">
          function SessionExpireAlert(timeout) {
            var seconds = timeout / 1000;
            document.getElementsByName("seconds").innerHTML = seconds;
            setInterval(function () {
                seconds--;
                document.getElementById("seconds").innerHTML = seconds;
            }, 1000);
            setTimeout(function () {
                $find("mpeTimeout").show();
            }, timeout - 30 * 1000);
            setTimeout(function () {
                window.location = "<%= Page.ResolveUrl("~/AppPages/WebForm3.aspx") %>" ;
            }, timeout);
        };
        function ResetSession() {
            window.location = window.location.href;
        }
    </script>


What I have tried:

Tried to check the possible properties of ModalPopupExtender and looked for options while showing the alert. And searched the web for the solution too.
Posted
Updated 10-Sep-19 7:11am

1 solution

You need to have an elevation manager in you js with buttons on your popups to manage their relation to each other.
 
Share this answer
 

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