开发者

C# WebPages : manage Exit events or quit with no user action server side

开发者 https://www.devze.com 2022-12-28 09:50 出处:网络
What is the better solution to manage Exit or Quit events when user exit to other pages with no action?. This event need to be raised only one time and be usefull to delete all temporary files or data

What is the better solution to manage Exit or Quit events when user exit to other pages with no action?. This event need to be raised only one time and be usefull to delete all temporary files or datas not stored a开发者_Go百科fter the abandon of this page. Is a perfect to use as cleaning method server side. Thanks.


The web is stateless so there shouldn't really be anything to clean up. However, sometimes you may want to kill the session when the user tries to close browser. I guess you could catch that event and then call the server (using AJAX) before closing the window:

How to capture the browser window close event?

Not 100% reliable though IMHO!

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号