如何在浏览器关闭事件上执行服务器端代码。 [英] How to Execute server side code on Browser close Event .

查看:174
本文介绍了如何在浏览器关闭事件上执行服务器端代码。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有一个Testmaster.master页面我添加了一个内容页面到该主页面Demo.aspx页面在浏览器关闭(X)符号我想执行一些操作,我想要执行服务器端的几个语句。我应该怎么做,我可以在添加母版页后在正常页面中使用标签我无法看到正文标签以及什么是内容页面中正文标记的替换

请让我通知

先谢谢。

Hi ,
I Have One Testmaster.master page and i added one content page to that master Page Demo.aspx Page on Browser close (X) Symbol i want to perform some operation ,and i want execute few statements of server side .what should i do for that , I Can do with in body Tag In Normal Pages after adding master Page am not able to see body tag and what was the replacement of body tag in Content Page
please let me inform
Thanks in Advance .

推荐答案

服务器不知道你关闭了浏览器所以你不能这样做。您可以做的最好的事情是使用Session End事件,该事件在用户超时时触发(如果他们停止查看您的站点,他们最终会这样做),但这不是很可靠。
The server has no idea you have closed the browser so you can't do this. The best you can do is use the Session End event which fires when the user times out (which they will eventually do if they stop viewing your site) but that's not very reliable.


这篇关于如何在浏览器关闭事件上执行服务器端代码。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆