Timer and Progressbar

I have a web timer which is supposed to update a progress bar in a container control.

The timer fires, but the progress bar does not move. In fact nothing on the container control updates in response to the timer.

While this is supposed to be happening, I am doing a query and preparing a file for downloading/emailing to my long-suffering user.

I thought web timers ran on the client. So, even though all the processing is being done server-side, do I still need to put it in a thread?

[quote=310612:@Bob Gordon]
I thought web timers ran on the client. So, even though all the processing is being done server-side, do I still need to put it in a thread?[/quote]

They do and they don’t. A timer fires on the client and calls back to the server to run it’s action event.

So:

  • you have to stop processing in the code that sets up the timer so the response (that includes the timer “running”) is send out to the client.

  • you can continue processing in a thread or…

  • you can have the first timer call-back trigger your processing. But as you are wanting the progress bar to update, you should do your processing in a thread and have the timer get reset repeatedly to go back to the web server and get the updated status.

Try implementing the multi-firing timer without the background processing first. When you get it working ok, then figure out how to bring in your actual background processing.

Steve,

Thanks for the suggestions. Looks like I need a thread. I’ll see what I can do.

-Bob