In summary
- Subscribe to the OnUnload event of the Body (<body OnUnload="Logout (); ">)
- Invoke the Static WebMethod (it will close session) from the function Javascript (PageMethods.AbandonSession ();)
- As when sailing to another page also it invokes the OnUnload event, it is necessary to make a last adjustment. All the pages of the application will be sailed from a IFRAME from a Content.aspx page. The trick is, the IFRAME makes navigation to other pages whereas Content.aspx this statics.
I read these articles before:
http://aspalliance.com/520
http://aspalliance.com/1294_CodeSnip_Handle_Browser_Close_Event_on_the_ServerSide
http://www.codeproject.com/csharp/Detect_closing_navigator.asp
http://geeks.ms/blogs/lruiz/archive/2007/02/27/controlar-cuando-el-usuario-nos-cierra-el-navegador-es-posible.aspx
http://www.programmersheaven.com/mb/ASPNET/303808/303808/readmessage.aspx
It works.
No comments:
Post a Comment