Last post Sep 13, 2011 10:46 PM by Otomii Lu - MSFT
Sep 09, 2011 09:54 AM|ramjet69|LINK
I have a situation (very common so I expect there is an SOP for this) where the session expires and then the user submits an update. Perhaps to a grid or tree control etc. Whatever it is the ViewState has changed and thus the viewstate exception. I know
I can handle session expiring in the global asax EXCEPT I did read one caveat that said unless you are using a web farm then the global asax session_end will be ignored. I don't see how a web farm would ignore this event UNLESS you changed the session state
and managed it in the database which would then make sense.
As for the browser being closed but the session still exists but the viewstate has changed.
From my research I found articles from 1997 and 1999 stating that you can't handle a browser close event server side. This also makes sense as the browser is closed and there is no more communication with the server. So is it still the best practice to just
Sep 13, 2011 10:46 PM|Otomii Lu - MSFT|LINK
According to your description, I guess you want a way to clear Session and treat with page unload.
I suggest you to refer to the link below:
And If you want to give a popup message when you leave a page:
The full document of ASP.NET Page Life Cycle provided below:
If you still have the problem, please let me know.