Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to make a Progress Bar / Monitor

Status
Not open for further replies.

apc2003

Programmer
Aug 29, 2003
54
GB
We have a task that runs and it take some time to complete.

As it runs we need to display to the user some sort of progress bar so they can know where the task is and how long until it competes.

Can anyone suggest how this can be done?

Regards in advance...
 
if you just need to have some animated thing showing up so that the user knows that something is happening, use an animated GIF.

if you need to have a real progress bar, then use two frames (one that does the actual work and set it to 0px height or width - depending on how you position it) and another that reloads itself every 1 second for example.
you will also need to have a session variable that contains the current progress value (20%, 30% ...)
as the work is being done, the frame doing the work modifies the session variable. this variable is read on every reload by the progress bar frame and displays the bar accordingly.

if you need more help in a certaing direction, post back.

--------------------------
"two wrongs don't make a right, but three lefts do" - the unknown sage
 
How do you get the display frame to resize from the session variable as this page will not be reloading the progress bar page is?

Regards...
 
How do you get the display page to read the Session variable as it will not be reloading the progress bar page will be?
 
session variables are available to all pages being called in the same session. therefore if you modify it from the page doing the work, the value will also be available through the session colletion to the progress bar page.

Session["currentValue"] = 10;

and retrieve it with
(int)Session["currentValue"]

the size of the two frames are always fixed. the only thing moving could be a a table's width. imagine a table with one row and and one cell containing another table with one row and one cell. the outer table would have a fixed dimension, while the inner one would have the width depending on the value of Session["currentValue"]

--------------------------
"two wrongs don't make a right, but three lefts do" - the unknown sage
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top