Closing a Window

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Maybe I should have been more precise.

Page1.asp does a window.open in client side vbscript. It then does a post to page2.asp
Page2.asp may take 5 minutes to process and when it is complete I want to close the window
that was opened by Page1. The idea is to put a message on the screen so the user doesn't close
Page2.asp while it is still processing. Any ideas?
 
What you could do is use a bit of javascript magic with the assistance of
the XMLHTTP object. You can write out a page that tells the user not to
close the window (which is a suboptimal design, I have to tell you - any
design that requires you to trust a user not to do something stupid should
be reconsidered) and then run a javascript that issues an asynchronous post
to the 5-minute asp script on your server. You can then subscribe a function
call to the onLoad event for the XMLHTTP object so that, once your script
has run and your page returns results, you can react by closing the window,
writing a different message to the user, or whatever you want to do.
 
Hi,

Firstly I want to thank Chris for his great help in this issue. Please
refer to his response carefully.

In addition, based on my research and experience, Calling Remote Scripting
Methods Asynchronously should be another option for your reference. Please
refer to the following URL for the detailed information.

Calling Remote Scripting Methods Asynchronously
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/rmscpt/Html
/rmscpt6.asp

I hope it helps.

Best regards,

Jacob Yang
Microsoft Online Partner Support
Get Secure! ¨C www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Back
Top