ASP Response Object

The ASP Response object is used to send output results from the server to the user.

Example

Use ASP to write text
This example demonstrates how to write text using ASP.
Use HTML tags to format text in ASP
This example demonstrates how to combine text and HTML tags using ASP.
Redirect the user to a different URL
This example demonstrates how to redirect the user to another URL.
Display random links
This example demonstrates a hyperlink that will display one of the two links each time the page is loaded.
Control cache
This example demonstrates how to control the cache.
Clear cache
This example demonstrates how to clear the cache.
Terminate the script during processing and return the result
This example demonstrates how to interrupt the script execution during the processing process.
Set how many minutes to cache the page in the browser before it expires
This example demonstrates how to specify the cache time before the page expires in the browser.
Set the cache expiration date or time in the browser for the page
This example demonstrates how to specify the cache time date or time of the page in the browser.
Check if the user is still connected to the server
This example demonstrates how to check if the user has disconnected from the server.
Set content type
This example demonstrates how to specify the content type.
Set character set
This example demonstrates how to specify the name of the character set.

Response object

The ASP Response object is used to send the output result from the server to the user. Its collection, properties, and methods are as follows:

Collection

Collection Description
Cookies Set the value of the cookie. If it does not exist, create a cookie and set the specified value.

Property

Property Description
Buffer Specify whether the output of the page is cached.
CacheControl Set whether the proxy server can cache the output generated by ASP.
Charset Append the name of the character set to the content-type header in the Response object.
ContentType Set the HTTP content type of the Response object.
Expires Set the browser cache time before the page expires (in minutes).
ExpiresAbsolute Set the date and time when the page cache on the browser becomes invalid.
IsClientConnected Indicate whether the client has disconnected from the server.
Pics Append values to the PICS flag in the response header.
Status Specify the value of the status line returned by the server.

Method

Method Description
AddHeader Add new HTTP headers and values to the HTTP response.
AppendToLog Append a string to the end of the server log entry (server log entry).
BinaryWrite Write data directly to the output without any character conversion.
Clear Clear cached HTML output.
End Stop processing the script and return the current result.
Flush Send cached HTML output immediately.
Redirect Redirect the user to another URL.
Write Write a specified string to the output.