Closing a webpage without confirmation

Hi, How can I close a web page using vb .net without the silly confirmation message that comes saying "The webpage your are viewing is trying to close the window" ?

Who is Participating?
DBAduck - Ben MillerConnect With a Mentor Principal ConsultantCommented:
You may be able to close it with this:
*** window hack removed *** mplungjan, ee page editor
return false;

You will always see prompt if you try to close a window that you did not page using javascript method. Closing the child window using window.close() method will not show the prompt.

gjutrasConnect With a Mentor Commented:
Here's a quote I found about window.close()

There is one thing that you should know about this code.  If you use the close method on a window that was not opened using script, Internet Explorer displays a message asking visitors if they want to close the window.  In Netscape Navigator and Mozilla, the code won't work at all, and the JavaScript console displays the message "Scripts may not close windows that were not opened by script."  So this example works best in a page that you display in a popup window using script code similar to the code I provided in my earlier post, open a page in a new window, mentioned above.
  The window only opend by only can be closed by window.close with out prompt. Otherwindows surly ask for prompt.
Michel PlungjanIT ExpertCommented:
@dbaduck: Please do not post this code on EE. It is a hack and it can be used for denial of service.
mplungjan, ee page editor
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.