Asp.net session expiry redirect to login page
问题 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 web.config file? 回答1: The trick to remember about the session expiration is that this happens in the the worker process running behind the scenes and there is no direct way to notify the user without going back to the server to check the state of things. What I do is I have the page register a Javascript block that will redirect the user to the login page