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. Advertising

  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. Advertising

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. Thomas Bindzau

    Re: ASPNET Session ending before time

    Thomas Bindzau, Jun 24, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    1,396
    Thomas Bindzau
    Jun 24, 2003
  2. Mohun Biswas
    Replies:
    2
    Views:
    587
    Mohun Biswas
    Apr 15, 2004
  3. Marek Kurowski
    Replies:
    1
    Views:
    1,005
    Mark A. Odell
    Aug 18, 2004
  4. Richard Lionheart
    Replies:
    4
    Views:
    291
    Richard Lionheart
    May 5, 2004
  5. Tobius
    Replies:
    3
    Views:
    120
    Thomas 'PointedEars' Lahn
    Mar 29, 2006
Loading...

Share This Page