ASP ResponseObject
The ASP Response object is used to send output to the user from the server.
Try it Yourself - Examples
Write text with ASP
This example demonstrates how to write text with ASP.
Format text with HTML tags in ASP
This example demonstrates how to combine text and HTML tags with ASP.
Redirect users to a different URL
This example demonstrates how to redirect a user to a different URL.
Display a random link
This example demonstrates how to create a random link.
Control the buffer
This example demonstrates how to control the buffer.
Clear the buffer
This example demonstrates how to clear the buffer.
Terminate the script and return results during processing
This example demonstrates how to terminate a script during processing.
Set the cache time for the page in the browser before it expires
This example demonstrates how to specify the cache time for a page in the browser before it expires.
Set the expiration date or time for the page cache in the browser
This example demonstrates how to specify the expiration date or time for a page cached in the browser.
Check whether a user is still connected to the server
This example demonstrates how to check whether a user has disconnected from the server.
Set the content type
This example demonstrates how to specify the type of content.
Set the character set name
This example demonstrates how to specify the name of the character set.
Response Object
The ASP Response object is used to send output to the user from the server. Its collections, properties, and methods are described below:
Collections
| Collection | Description |
|---|---|
| Cookies | Sets the value of a cookie. If the cookie does not exist, creates the cookie and sets the specified value. |
Properties
| Property | Description |
|---|---|
| Buffer | Specifies whether to buffer the output of the page. |
| CacheControl | Sets whether a proxy server can cache the output generated by ASP. |
| Charset | Appends the name of the character set to the content-type header in the Response object. |
| ContentType | Sets the HTTP content type of the Response object. |
| Expires | Sets the browser cache time (in minutes) for the page before it expires. |
| ExpiresAbsolute | Sets the date and time at which the page cache in the browser expires. |
| IsClientConnected | Indicates whether the client is disconnected from the server. |
| Pics | Appends a value to the PICS tag of the response header. |
| Status | Specifies the value of the status line returned by the server. |
Methods
| Method | Description |
|---|---|
| AddHeader | Adds a new HTTP header and value to the HTTP response. |
| AppendToLog | Adds a string to the end of a server log entry. |
| BinaryWrite | Writes data directly to the output without any character conversion. |
| Clear | Clears the buffered HTML output. |
| End | Stops processing the script and returns the current result. |
| Flush | Sends the buffered HTML output immediately. |
| Redirect | Redirects the user to a different URL. |
| Write | Writes the specified string to the output. |