[E路客] asp 在线状态

来源:互联网 发布:excel合并重复数据 编辑:程序博客网 时间:2024/06/10 03:56

如果是正常退出那直接取Session["userid"]做更新即可。那要是用户直接关闭页面怎么去做更新事件。
我测试过IE7、火狐、浏览器用到js
function window.onunload() 
  {
  //true关闭浏览器\false刷新浏览器
  //window.event.clientX>document.body.clientWidth&& window.event.clientY<0 || window.event.altKey
  //window.event.screenX - window.screenLeft>document.documentElement.scrollWidth-20&&window.event.clientY < 0 || window.event.altKey
  if(window.event.screenX - window.screenLeft>document.documentElement.scrollWidth-20&&window.event.clientY < 0 || window.event.altKey) 
  { 
   
  document.getElementById("bntExit").click();
  }

  }
  在if里会自动判断是刷新页面还是关闭页面。。关闭页面则进入if,我是用脚本获取服务器控件在调用它的点击事件做。

  这个测试唯独在傲游浏览器上不成功。。在傲游中只有更新调用。关闭就不调用了。。。。。
楼主的问题应该跟我所做的是一样。。我也是为了控制用户离开后更新下线。。。。也正在寻找更好的办法!

exec sp_msforeachtable "truncate table ?" 一次清空所有表数据

本文出自E路客

原创粉丝点击