By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,304 Members | 3,201 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,304 IT Pros & Developers. It's quick & easy.

asp.net: annimated gif while stored proc runs in the background

P: n/a
ASP.NET: Any suggestions on how to display an animated .gif file on a web
page while a stored procedure is running in the background? For example, on
some of the airline sites, it asks you to wait while a reservation is being
placed. During that time that the process is running on the server, they
frequently show some sort of graphic that implies "don't touch anything -
we're working."

The problem:
If I post a page with the graphic, but in the same piece of code I execute
the stored proc, the page doesn't actually display the graphic until the
stored procedure is completed, which defeats the purpose. It's feels like I
need to display the graphic, then magically force yet another postback??

Thanks in advance!

Mark

Nov 15 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a

"Mark" <fi**************@umn.edu> wrote in message
news:eh**************@TK2MSFTNGP12.phx.gbl...
ASP.NET: Any suggestions on how to display an animated .gif file on a web page while a stored procedure is running in the background? For example, on some of the airline sites, it asks you to wait while a reservation is being placed. During that time that the process is running on the server, they frequently show some sort of graphic that implies "don't touch anything - we're working."

The problem:
If I post a page with the graphic, but in the same piece of code I execute the stored proc, the page doesn't actually display the graphic until the stored procedure is completed, which defeats the purpose. It's feels like I need to display the graphic, then magically force yet another

postback??

You can:

- Have a hidden frame which actually does the stored proc work and
then returns some type of code in a javascript variable. In your
main frame, have your animated gif and a Javascript timer that
checks the other frame to see if that variable is set yet

- Spawn a thread to do the DB work and then have your page redirect
to the "Progress" page which immediately checks to see if the work
is done. If not, it waits (while the gif is running on the client)
and refreshes every X seconds. On the refresh, the page again checks
the status of the thread. If it's ready, it redirects to the DONE
page, if not, it starts the cycle again.

This might be bad because if you had lots of users, that's lots of
threads, but I've seen it done before and it seems to work well.

There's a 3rd one that I'm missing and it's pretty good, but
I can't remember it right now. If it comes to me again, I'll repost.

-c
Nov 15 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.