我也想知道,试了onUnload事件,但不太合适,fire this event too much,include F5 key,close current window,use mouse point "refurbish"

解决方案 »

  1.   

    感觉只能用JS调用ASP文件,客户端的JS文件理论上是无法操作服务器文件的。
      

  2.   

    只能是用这种方法.
    发送请求.Clear.asp
    Clear.asp实现清除Sessiondemo.htm<script>
    window.onbeforeunload=function()
    {
        var oBao = new ActiveXObject("Microsoft.XMLHTTP");
        oBao.open("POST","Clear.asp",false);
        oBao.send();
    }
    </script>
    Clear.asp<% @Language="JavaScript" %>
    <%
    Session.Abandon();
    Session.Contents.RemoveAll();
    %>
      

  3.   


    在浏览器关闭前产生一个http请求,不能用纯粹的js或html实现吗?如果在LINUX或非IE时,就不可能实现了吗?