Lesson 4: Creating an HTTP Response

The Response Object

The Response object enables you to control the information sent to a user by the HTTP response message.

Properties and Methods

The Response object provides properties and methods that you can use when sending information to the user.

The following table lists and describes some properties of the Response object.


Property Description
Buffer Indicates whether or not a response is buffered.
Expires Specifies how long a page will remain cached on a browser before it expires.
ExpiresAbsolute Specifies the date and time on which a page cached on a Web browser will expire.

The following table lists and describes some methods of the Response object.


Method Description
Clear Clears any buffered response.
End Stops the processing of a Web page and returns whatever information has been processed so far.
Flush Sends buffered output immediately.
Redirect Sends a redirect message to the user, causing the response message to try to connect to a different URL.
Write Writes a variable to the current HTTP output as a string.

The Response object also contains the Cookies collection, which you can use to specify the value of a cookie.

Response Object Syntax

Syntax Use the following syntax for the properties and methods of the Response object:
 Response.  propertymethod  

Example

This example sets the Expires property of the Response object to zero. This indicates that the content of the response message returned to the user will expire immediately:
 <% Response.Expires = 0 %> 

If the user returns to the Web page, its content will be refreshed and displayed by the Web server.



Microsoft Windows Architecture Training
Microsoft Windows Architecture for Developers Training Kit
ISBN: B00007FY9D
EAN: N/A
Year: 1998
Pages: 324

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net