progress bar or guage bar

Discussion in 'ASP General' started by Rob, Jul 11, 2003.

  1. Rob

    Rob Guest

    Hi all,

    Is it possible to do a progress bar of gauge bar in asp? If possible could
    someone show some sample code on it.

    Many thanks,
    Rob, Jul 11, 2003
    1. Advertisements

  2. Rob

    Chris Barber Guest

    You can do a 'sort of' progress bar if you create a button (<INPUT
    type="button"/>) and then as the page content loads use an embedded
    Javascript to change the value (eg. text) of the button.
    I think you have to set Response.Buffer = True and repeatedly call
    Response.Flush after you write the JavaScript bit.

    Chris Barber, Jul 12, 2003
    1. Advertisements

  3. Rob

    Tim Williams Guest

    That depends on what you're doing....

    If you have 100 submitted records to update on the server (and it might take
    a while) then you can write out an update every ten records and flush it to
    the client. That seems pretty accurate.

    Tim Williams, Jul 12, 2003
  4. Rob

    Tim Williams Guest

    I agree that it's not always applicable, but can be useful in (rare)
    circumstances, such as when having to conduct a relatively slow operation in
    a loop.

    As you note, if the response.write and flush are enough to significantly
    slow down execution of the page then you probably don't need it.

    Tim Williams, Jul 12, 2003
  5. Rob

    Chris Barber Guest

    I have used it to good effect in intranet applications where database
    pre-processing may take up to 30 seconds to achieve (we're talking Stored
    Procedures checking over 100s of millions of rows in batches of approx. 1
    million - GPS positions for tracked vehicles) and I can tell you that users
    get all ready to click like crazy unless you give them a % progress bar.

    Chris Barber, Jul 12, 2003
  6. Rob

    Chris Barber Guest

    Well - yes but not for 'real' situations that warrant letting the user
    actually know when something will finsh as opposed to saying 'It might
    finish sometime or of course it could be hung with an error at the server
    that I'm not going to tell you about'.
    A classic good use of a progress bar is the Windows Update. That can take up
    to a minute or more and it's nice to able to see the % (whether actual or
    estimated) progress.


    Chris Barber, Jul 12, 2003
  7. Rob

    Chris Barber Guest

    Wisconsin eh! - I'll drop by on my way to Barbados in about 6 weeks - OK?

    Now .. Wisconsin is about as far as London from Derbyshire (120 miles?) ...
    wheres that Cubs map of the world gone now .... LoL.


    Chris Barber, Jul 12, 2003
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.