Display text before ending the script

Discussion in 'ASP General' started by andre.labonte@gmail.com, Oct 27, 2006.

  1. Guest

    Hi!

    I have a script that is taking some time to run and in my page, i've
    placed some comments to be displayed on the webpage so I can know what
    the script is currently running.
    Unfortunately, the HTML page is displayed ONLY when the script is
    entirely finished.
    I'd like the comments placed within the script to be displayed as soon
    as the script is reading them, not at the end!

    (I don't know if i'm clear enough, here's an example)

    CURRENTLY:

    (script running)
    ....
    (script end)
    HTML page will show:
    The script is starting...
    Script step 1...
    Script step 2...
    Done!


    WHAT I'D LIKE IT TO DO:

    (script running)
    The script is starting...
    (script continues)
    Script step 1...
    (script continues)
    Script step 2...
    (script end)
    Done!

    Thanks!
    Andrew
     
    , Oct 27, 2006
    #1
    1. Advertisements

  2. wrote:
    > Hi!
    >
    > I have a script that is taking some time to run and in my page, i've
    > placed some comments to be displayed on the webpage so I can know what
    > the script is currently running.
    > Unfortunately, the HTML page is displayed ONLY when the script is
    > entirely finished.
    > I'd like the comments placed within the script to be displayed as soon
    > as the script is reading them, not at the end!
    >


    You need to turn the response buffer on and, when you want the output
    sent to the client, flush the buffer

    Response.Buffer = True
    ....
    Response.Flush
    ....
    Response.Flush

    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.
     
    Bob Barrows [MVP], Oct 27, 2006
    #2
    1. Advertisements

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jim Owen
    Replies:
    1
    Views:
    608
    Natty Gur
    Jul 24, 2003
  2. Mohun Biswas
    Replies:
    2
    Views:
    694
    Mohun Biswas
    Apr 15, 2004
  3. Marek Kurowski
    Replies:
    1
    Views:
    1,264
    Mark A. Odell
    Aug 18, 2004
  4. Rajat
    Replies:
    3
    Views:
    990
    Jorgen Grahn
    Jan 8, 2010
  5. display text in text box

    , Dec 7, 2005, in forum: ASP General
    Replies:
    1
    Views:
    189
    Evertjan.
    Dec 7, 2005
  6. Richard Lionheart
    Replies:
    4
    Views:
    469
    Richard Lionheart
    May 5, 2004
  7. Tobius
    Replies:
    3
    Views:
    188
    Thomas 'PointedEars' Lahn
    Mar 29, 2006
  8. Replies:
    19
    Views:
    456
    Andreas Perstinger
    Oct 7, 2013
Loading...