none
Getting popup window in desktop (Outside application page)

    Question

  • I m working on asp.net MVC and used session timeout for the application using javascript. Sometimes the popup go behind the main window in IE. It means that the popup from webpage for expired session starts displaying in the desktop also. 

    Here is the code:

    var sess_pollInterval = 60000;
    var sess_expirationMinutes = 20.99;
    var sess_intervalID;
    var sess_lastActivity;
    
    function initSession() {
     sess_lastActivity = new Date();
     sessSetInterval();
     $(document).bind('keypress.session', function (ed, e) {
     sessKeyPressed(ed, e);
    });
    }
    function sessSetInterval() {
    sess_intervalID = setInterval('sessInterval()', sess_pollInterval);
    }
    function sessClearInterval() {
    clearInterval(sess_intervalID);
    }
    function sessKeyPressed(ed, e) {
    sess_lastActivity = new Date();
    }
    function sessLogOut() {
    window.location.href = '/UserLogin/sessionOut';
    }
    function sessInterval() {
    var now = new Date();
    var diff = now - sess_lastActivity;
    var diffMins = (diff / 1000/60 );
    
    if (diffMins >= sess_expirationMinutes) 
    sessClearInterval();
    sessLogOut();
    alert('Session has been expired.');
        }
    

    Please do the needful!

    Saturday, April 8, 2017 8:54 AM

All replies

  • Hi Sneha_123,

    Thank you for posting here.

    According to your question is more related to MVC, you could post a new thread in MVC forum for suitable support.

    The Visual C# discuss and ask the C# programming language, IDE, libraries, samples and tools.

    If you have some grammar or code errors, please feel free to contact us. We will try our best to give you a solution.

    Thanks for your understanding and cooperation.

    Best Regards,

    Wendy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, April 10, 2017 5:54 AM