
Cookies | 369
HttpResponse
Class
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
Example
See the example for the StatusCode property.
Notes
As with other properties that set HTTP response headers, this property cannot be
set once HTTP body output has been sent to the client (using Response.Write or
similar methods) when buffering has been turned off.
SuppressContent
Boolean = Response.SuppressContent
Response.SuppressContent = Boolean
Returns or sets a Boolean indicating whether HTTP output should be sent to the
client.
Parameter
Boolean
A Boolean variable to receive or set the value of the property. The default is
False; content is sent to the client.
Example
The following example writes the text “Hello, World!” to the output (which is
buffered by default) and sets SuppressContent to
True so that no output is sent to
the client.
Sub Page_Load( )
Response.Write("Hello, World!")
Response.SuppressContent = True
If Response.SuppressContent Then Response.Close( )
End Sub
Notes
Since SuppressContent prevents any output from being returned to the client
(including any error messages), the Response.Close method (which closes the
network connection to the client) must be called to prevent the client browser
from hanging indefinitely.
Collections Reference
The Response object in ASP.NET supports only a single collection, the Cookies
collection.
Cookies
HttpCookieCollection ...