What's the best way to hold an ASP.NET page until a long running operation completes?
Look at the options:
Javascript?
This works fine unless the user has disabled it.
Meta tag update?
Deprecated method in favor of Javascript method. However, you can use it as a backup if the user has Javascript disabled.
Response.Redirect (for yourself)
This doesn't work as the browser will not show anything useful to the user when redirecting. In addition, the browser will stop prompting after a certain number of redirects to protect the user from endless redirects.
Server.Transfer (to self)
Doesn't work as the code on the server will just loop without sending anything to the browser. The effect is the same as having a loop in your code.
Ajax refresh panel?
Works great if the user hasn't disabled Javascript. This is basically the same as the first option, only Javascript makes the request itself rather than letting the browser make the request.
a source to share
If you can report any progress to the user, I tend to run with asxh and variation forever. Throw in some jQuery UI Dialog and jQuery UI Progress Bar and you have a brilliant way to grab the attention of users when you are doing heavy server work.
I have provided example code at 874204 that demonstrates the technique.
If you can't make progress for the user, I tend to still use the UI dialog and come out with a "please wait, processing ..." message with web two dots compatible with gif spinning.
a source to share
Check out this article Asynchronous Pages . There's also an example from CodeProject that includes asynchronous pages and META-REFRESH.
a source to share
You can find an example of this kind of functionality in the Beer House Starter Kit - http://www.asp.net/Downloads/starter-kits/the-beer-house/ .
The SendingNewsLetter.aspx and SendNewsLetter.aspx pages will be useful to you. It may be overkill for your need, although it even shows the progress of long-term work.
a source to share