0

Hi,

I would like to know what does this mean?
I have this script loaded in page_load from my master page

Page.ClientScript.RegisterStartupScript(Me.[GetType](), "onLoad", "DisplaySessionTimeout()", True)

and a javascript data in my mastepage.aspx

            var sessionTimeout = "<%= Session.Timeout %>";
            function DisplaySessionTimeout() {
                //assigning minutes left to session timeout to Label
                document.getElementById("<%= lblSessionTime.ClientID %>").innerText = sessionTimeout;
                sessionTimeout = sessionTimeout - 1;

                //if session is not less than 0
                if (sessionTimeout >= 0)
                //call the function again after 1 minute delay
                    window.setTimeout("DisplaySessionTimeout()", 10000);
                else 
                {
                    //show message box
                    alert("Your current Session is over.");
                    window.location.href("Login.aspx");
                }
            }

In first page, this works properly.. but in when I redirect to another page, it doesn't work. Please help. Thank you in advance.

Edited by Reverend Jim: wrong forum

2
Contributors
2
Replies
16
Views
3 Years
Discussion Span
Last Post by JorgeM
0

For this problem, I just inserted (;) after DisplaySessionTimeout

Page.ClientScript.RegisterStartupScript(Me.[GetType](), "onLoad", "DisplaySessionTimeout();", True)

but I got an error when it re-directs to another page.

folder/Login.aspx appears.. it should be Login.aspx only..

0

What error are you encountering?

Is login.aspx located on the root folder? Try...

 window.location.href("/Login.aspx")
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.