if session expires whether the viewstate remains?
i have set the session timeout to 20 minutes in IIS level and there is no session entries in the web.config.
How 开发者_如何学Gocan i know whether my session exprired in my website?
does the state will maintain ? do i can see the values in the text-boxes after the timeout?
Viewstate remains. Since ASP.Net still relies on good ol' HTTP forms processing, you can just read request.forms to see the posted values.
As far as seeing if the session espired, take the session ID and store it in a hidden input or even a ViewState property, then compare the stored session ID with the 'current' session ID and if they're different then a new session has started.
Below link show you the implementation of how you can check that new session is created and take the necessary steps
Viewstate will be maintained
Detecting ASPNET_Session_Timeouts
Stackoverflow question answered here
Session Expired
精彩评论