Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

ASP Buffer Property

ASP Buffer Property


Response Object Reference Complete Response object reference manual


The Buffer property specifies whether output is buffered. Normally, ASP scripts execute on the server and each statement's result is sent to the client's browser for display. When output is buffered, the server holds back the response to the browser until all server scripts have been processed, or until the script calls the Flush or End method.

**Note:** If you want to set this property, it must appear before the tag in the .asp file.

Syntax

response.Buffer[=flag]

Parameters Description
flag A Boolean value specifying whether to buffer the page output.

False indicates no buffering; the server sends output as it processes. The default is False in IIS version 4.0, and True in IIS version 5.0 and later.

True indicates buffering. The server does not send output until all scripts on the page have been processed, or until the Flush or End method is called.

Example

Example 1

In this example, no output is sent to the browser until the loop finishes. If buffer is set to False, one line is output to the browser on each iteration.

<%response.Buffer=true%>

<%

for i=1 to 100

  response.write(i & "
")

next

%>

Example 2

<%response.Buffer=true%>

I write some text, but I will control when

the text will be sent to the browser.

The text is not sent yet. I hold it back!

OK, let it go!

<%response.Flush%>

Example 3

<%response.Buffer=true%>

This is some text I want to send to the user.

No, I changed my mind. I want to clear the text.

<%response.Clear%>


Response Object Reference Complete Response object reference manual