
BufferOutput | 359
HttpResponse
Class
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
BufferOutput
Boolean = Response.BufferOutput
Response.BufferOutput = Boolean
Returns or sets a Boolean value that represents whether output is buffered on the
server and sent when the request has completely finished processing, or when
either the Response.Flush or Response.End methods are called. The default value
is
True.
Parameter
Boolean
A Boolean that will receive or set the value of the property.
Example
The example sets the BufferOutput property to False and then loops 50 times,
writing a period to the HTTP output with each loop iteration. It also writes the
same output to the Text property of the Message Label control. For the first 10
and the last 21 iterations, BufferOutput is set to
False; for iterations 11 through
29, it is set to
True.
Sub Page_Load( )
Response.BufferOutput = False
Dim i As Integer
For i = 1 To 50
If (i > 10 And i < 30) Then
Response.BufferOutput = True
Else
Response.BufferOutput = False
End If
System.Threading.Thread.Sleep(500)
Response.Write(".")
Message.Text &= "."
'Response.Flush
Next
Response.Write("<br/>Done!<br/>")
Message.Text &= "<br/>Done!<br/>"
End Sub
The output of the code would look something like this:
.................................................. Done! ................
.................................. Done! ...