For Programmers: Free Programming Magazines  


Home > Archive > ASP > October 2006 > Display text before ending the script









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Display text before ending the script
andre.labonte@gmail.com

2006-10-30, 6:59 pm

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

Bob Barrows [MVP]

2006-10-30, 6:59 pm

andre.labonte@gmail.com 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.


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com