one way or the other, you have to use javascript, try the following (although it doesn't always work):<script language="javascript">
function window.onunload()
{
  if (event.clientX <0 && event.clientY <0 )
   window.open("logout.aspx","logout");
}
</script>logout.aspx:
<% session["IsPage_xxClosed"] = "1" %>

解决方案 »

  1.   

    用javascript<script language=javascript>
    function window.onunload()
    {
      if(event.clientX<0 && event.clientY<0)
    {
        <%# ChangeSessionValue()%>    //服务器端方法,改变Session的值
    }
    }
    </script>
    cs中public void ChangeSessionValue()
    {
        Session["IsPage_xxClosed"]=1;
    }
      

  2.   

    1,只能通过javascript2,你是怎样关闭XX。ASPX页的?用按钮吗?  准备一个退出按钮 ,就在那个按钮事件中写不就可以了吗 ;如果你是点IE的关闭按钮,那应该没有办法做了
      

  3.   

    你要非想窗口关闭就给session赋值最好就用思归的方法,
    在窗口关闭时强制打开一个窗口,并在窗口里面完成session判断