早上起来看到在google订阅中看到aspalliance的一篇文章,立即饶有兴趣地阅读起来,题目的标题是:
Handle Browser Close Event on the Server-Side
意为在服务器端捕获浏览器关闭事件。这个技术是一个众所周知的难题,我想看看他是怎么解决的。结果看下去原来使用的body的onunload事件,触发asp.net ajax 的pagemethod来释放服务器端的资源,很奇怪,这样可以吗?当刷新postback,都回导致onunload事件的触发,难道你都要释放一次资源不成?结果在评论的第一条:
This article seemed promising, but unfortunately the javascript chain of events is going to cause undesired results.
第二条评论:
Another option for this case is that you use a keep alive functionality in your web application. after implementing keep alive, u can keep your session expire time to a short interval, say 1 or 2 mins. through this u can check for the session after every 1 or 2 mins and abandon it accordingly
不过真是汗一个:国外的mvp都写这样的没有经过自己测试的文章,就发布到我觉得如同圣经般的网站上去吗?比起院子里的吕震宇和老赵等大侠,真是要汗一汗了....比起国外的开发人员,园子里的小兄弟们算幸福的了
相关文章: