Question

Javascript?

Metatag refresh?

Response.Redirect (to self)

Server.Transfer (to self)

Ajax update panel?

Was it helpful?

Solution

Let's look at the options:

Javascript?

That works fine, as long as the user haven't disabled it.

Metatag refresh?

A deprecated method in favour of the Javascript method. However, you could use it as a backup if the user has disabled Javascript.

Response.Redirect (to self)

That doesn't work, as the browser would not show anyhing useful for the user while redirecting. Also, the browser will stop requesting after a certain number of redirects to protect the user from infinite redirects.

Server.Transfer (to self)

Doesn't work either, as the code on the server would just loop without sending anything to the browser. The effect is the same as just having a loop in your code.

Ajax update panel?

Works fine, as long as the user haven't disabled Javascript. It's basically the same as the first option, only the Javascript does the request itself instead of letting the browser do the request.

OTHER TIPS

If you can report any kind of progress to the user, I tend to run with an asxh and a variation of a forever frame. Add a bit of jQuery UI Dialog and jQuery UI Progress Bar and you've got a shiny way of holding the users attention while you do the heavy lifting on the server.

I gave some example code at 874204 that demonstrates the technique.

If you can't give progress to the user, I tend to still use UI dialog and pop a "please wait, processing..." message with a web two dot oh compliant spinny gif.

Check out this article on Asynchronous Pages. Here's also an example from CodeProject that includes Asynchronous pages and META-REFRESH.

You can find a sample implementation of this kind of functionality in the Beer House Starter Kit- http://www.asp.net/Downloads/starter-kits/the-beer-house/.

The pages SendingNewsLetter.aspx and SendNewsLetter.aspx will be useful to you. This might be overkill for your need though- it even shows progress of the long running operation.

What about using the AJAX WebModalAnchor to pop up a window with a cancel button?

Hope this helps,

Bill

I'd recommend using Ajax and displaying an UpdateProgress so the user knows it's still churning away.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top