I've needed to do a similar thing, but took a slightly different
approach. On the submit button, it calls a javascript function which
opens a "Please Wait" modeless dialog. In the URL of the Please Wait
window I pass the postback ID and EventArg of the button (which would be
used for the __doPostBack()) in the querystring and I pass the Window
object into the window.showModelessDialog() method similar to the
example here:
http://msdn.microsoft.com/library/de...p/author/dhtml
/reference/methods/showmodelessdialog.asp
Then I have a ContinuePostBack() method in the main page where the
submit button exists which takes the EventID and EventArg and simply
calls the __doPostBack() event. When the Please Wait window opens, it
calls the ContinuePostBack function on the main window and passes in the
EventID and EventArg from its URL. The ContinuePostBack will start the
PostBack process which after it completes the page refreshes which
clears the Please Wait modeless dialog, so you don't have to worry about
trying to close that window. I originally tried to just open the Please
Wait window then continue with the __doPostBack, but I think there was a
timing issue because the Please Wait would not always display. So I
resolved that by having the Please Wait window be the thing that called
the ContinuePostBack function... that gaurantees the window will open
before the postback starts.
I'm thinking about taking this another step by having the long process
write status messages to a session variable and having the Please Wait
window auto-refresh and read that session variable every 5 seconds or
so.
*** Sent via Developersdex
http://www.developersdex.com ***