
End | 379
HttpResponse
Class
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
ClearHeaders
Response.ClearHeaders( )
Clears the HTTP headers from the current output stream.
Parameters
None
Example
The example sets the HTTP Content-Type header to "text/xml", clears the HTTP
headers by calling the ClearHeaders method, and then writes the value of the
Response.ContentType property to the Text property of the Message ASP.NET
Label control. The displayed Content-Type is the default of
"text/html".
Sub Page_Load( )
Response.AppendHeader("Content-Type", "text/xml")
Response.ClearHeaders( )
Message.Text = Response.ContentType
End Sub
Notes
The ClearHeaders method clears only the HTTP response headers, not the buff-
ered content.
Close
Response.Close( )
Closes the network socket for the current response.
Parameters
None
Example
See the example for the SuppressContent property.
Notes
The Close method can be used to immediately close the network socket for the
current response. This closure will typically result in a browser error (such as
“Cannot find server”) being displayed to the client.
End
Response.End( )
Stops processing the current request and sends all buffered content to the client
immediately.
Parameters
None