Results 1 to 4 of 4

Thread: Close current window

  1. #1
    Guest
    In an ASP, either through a link or through a button, how can I close the current window (which was not opened through the open method) - without the user geting prompted - and open a new window?

    The window.close gives a message like

    "The web page is trying to close the window you are currently in. Do you wish to close the window"

    Thanks for any help


  2. #2
    Member
    Join Date
    Nov 2000
    Posts
    62
    Try the ASP forum.

  3. #3
    Guest
    Can you use JavaScript?

    Code:
    <script language="javascript">
    
    function CloseWin()
    {
    window.close();
    };
    
    </script>
    
    
    <HTML>
    <BODY>
    
    <input type="button" value="Close" onClick="javascript:CloseWin();" return true";>		
    
    </BODY>
    </HTML>

  4. #4
    Guest
    Matthew,
    This still prompts the user to confirm if the window can be closed.
    Acc to MSDN, when window.close() is executed in a window which was not explicitly opened wth an open statement, the user is prompted. I was wondering may be there is a way to circumvent this prompt.


    Also, is there something similar to VB's cancel in form_unload
    in the window object?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width