
378
|
Chapter 17: The HttpResponse Class
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
you should set the Response.ContentType property to the appropriate MIME type
for the image type being sent (such as
"image/jpg").
Clear
Response.Clear( )
Clears the content of the current output stream.
Parameters
None
Notes
The Clear method clears all currently buffered output, but does not clear the
HTTP response headers. If buffering of output is disabled by setting the Buffer-
Output property to
False, this method will not have any effect, since it only clears
buffered content. This behavior is different from classic ASP, in which calling
Clear when buffering is disabled results in an error.
ClearContent
Response.ClearContent( )
Clears the content of the current output stream.
Parameters
None
Example
The example writes a text message using Response.Write and then clears the buff-
ered output by calling Response.Clear. If buffering is on, the text message will
never be sent to the browser.
Sub Page_Load( )
Response.Write("This content will not be seen.")
Response.Clear( )
Message.Text = _
"Content written with <i>Response.Write</i> was cleared."
End Sub
Notes
The ClearContent method clears all currently buffered output, but does not clear
the HTTP response headers. HTTP headers can be cleared by calling the Clear-
Headers method. If buffering of output