use javascript:<script language="javascript">
function window.onunload()
{
  if (event.clientX < 0 && event.clientY <0)
      alert("closing!");
}
</script>

解决方案 »

  1.   

    在这个里面可以将session ("id") 清空吗??这个写在那里html中吗??如果要是vb.net也是这么些吗??
      

  2.   

    the following doesn't always work (for example, when the user browses to another page):<script language="javascript">
    function window.onunload()
    {
      if (event.clientX < 0 && event.clientY <0)
          window.open("logout.aspx","newwin");
    }
    </script>
    in logout.aspx, call
    <%Session.Abandon()%>
      

  3.   

    把window.open()改成用xmlhttp发xml包给logout.aspx最好, 那样也不会有弹出窗口的问题了