eWebProgrammer eweb

ASP   «Prev  
ASP's Response object

Buffering output with the Response Object

Buffering output allows you to delay the flow of data and then release the stored data all of it at once. You can set the Response object's Buffer property to True or False, depending on whether you want buffered output.
The Buffer property specifies whether to buffer the output or not. When the output is buffered, the server will hold back the response to the browser until all of the server scripts have been processed, or until the script calls the Flush or End method.
If this property is set, it should be before the <html> tag in the .asp file Syntax

If you do use buffered output, nothing is sent to the browser until one of three things happens:
  1. You call the Response object's End() method, which stops the processing;
  2. You call the Flush() method, which sends all the output buffered so far; or
  3. All the ASP scripts on the page have been processed.
You can't change the value of the Buffer property if you've already sent output to the client, so you should set it in the first line of the ASP file.
One caution to using this technique: the user sees no data being transmitted during the time that it is accumulating. After only a minute or two of waiting, the user may assume the connection to the server has been broken and leave the Web site.