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" %>
function window.onunload()
{
if (event.clientX <0 && event.clientY <0 )
window.open("logout.aspx","logout");
}
</script>logout.aspx:
<% session["IsPage_xxClosed"] = "1" %>
function window.onunload()
{
if(event.clientX<0 && event.clientY<0)
{
<%# ChangeSessionValue()%> //服务器端方法,改变Session的值
}
}
</script>
cs中public void ChangeSessionValue()
{
Session["IsPage_xxClosed"]=1;
}
在窗口关闭时强制打开一个窗口,并在窗口里面完成session判断