Click here to Skip to main content
14,298,693 members
Rate this:
Please Sign up or sign in to vote.
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"
    OkControlID="btnYes" CancelControlID="btnNo" BackgroundCssClass="modalBackground" OnOkScript = "ResetSession()">

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

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.
Updated 10-Sep-19 7:11am

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

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

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

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100