What is the best way to redirect to the login page when the session expires. I\'m using
sessionState mode=\"InProc\"
Can I set this in the
Bellow Answer is the best example ever and ever......
Better to try this way:
Page.ClientScript.RegisterStartupScript(Me.GetType, "TimeoutScript", "setTimeout(""top.location.href = '~/Login.aspx'""," & ConfigurationManager.AppSettings("SessionTimeoutMilliseconds") & ");", True)
You'll notice that I have the actual milliseconds stored in my web.config file so that I can adjust the timeout length as needed.
Using this, combined with the typical Session_End event in the Global.asax file makes a pretty clean way of handling session timeouts in my web apps.
Regards, Nagaraju R || Dell PerotSystems ||