page_unload
当服务器控件从内存中卸载时发生,不是关闭窗口还是需要用客户端的事件关闭时的方法:
function window.onunload()
{
   alert("窗体关闭了!");
}
如果需要在关闭前给用户关闭提示,而且想在用户点击浏览器关闭按钮关闭时,也只有用以下的方法才能在退出时,执行事件: function window.onbeforeunload()   
{   
    if( event.clientX>document.body.clientWidth && event.clientY<0 || event.altKey )   
    {   
        window.event.returnValue="确定要退出本页吗?";   
    }
}