当前位置: 动力学知识库 > 问答 > 编程问答 >

c# - redirect to other page once click close the current page in asp.net

问题描述:

I am new to JavaScript Programming. What I want to do is the following:

I am opening popup window for the user to print something. once he finishes, he will close the page. I want the portal to open another page once he closes this page. I tried the following:

<body onbeforeunload="window.open('BondData.aspx');">

but it does not work. Can you please guide me to an idea where I can get this working?

Thanks in advance

网友答案:

try this:

Add this code on page on which you going to close

<script >
window.onbeforeunload =      

  function ()
    {

    window.open('NewPage.aspx');
    };
</script >
分享给朋友:
您可能感兴趣的文章:
随机阅读: