The Response Object | |
The Response object is used to access the response that is being created to send back to the client. It makes available the HTTP variables that identify the server and its capabilities, information about the content being sent to the browser, and any new cookies that will be stored on the browser for this domain. It also provides a series of methods that are used to create the returned page. |
Cookies | |
Collection | |
A collection containing the values of all the cookies that will be sent back to the client in the current response. Each member is write only. |
Buffer | |
Boolean | Property |
Read/write. Specifies if the output created by an ASP page will be held in the IIS buffer until all of the server scripts in the current page have been processed, or until the Flush or End method is called. It must be set before any output is sent to IIS, including HTTP header information, so it should be the first line of the .asp file after the <%@LANGUAGE=..%> statement. Buffering is on (True) by default in ASP 3.0, whereas it was off (False) by default in earlier versions. |
CacheControl | |
String ("Public"|"Private") | Property |
Read/write. Set this property to "Public" to allow proxy servers to cache the page, or "Private" to prevent proxy caching taking place. |
Charset | |
String | Property |
Read/write. Appends the name of the character set (for example, ISO-LATIN-7) to the HTTP Content-Type header created by the server for each response. |
ContentType | |
String | Property |
Read/write. Specifies the HTTP content type for the response, as a standard MIME-type (such as "text/xml" or "image/gif"). If omitted, the MIME-type "text/html" is used. The content type tells the browser what type of content to expect. |
Expires | |
Number | Property |
Read/write. Specifies the length of time in minutes that a page is valid for. If the user returns to the same page before it expires, the cached version is displayed. After that period, it expires and should not be held in a private (user) or public (proxy) cache. |
ExpiresAbsolute | |
Date/Time (#date[time]#) | Property |
Read/write. Specifies the absolute date and time when a page will expire and no longer be valid. If the user returns to the same page before it expires, the cached version is displayed. After that time, it expires and should not be held in a private (user) or public (proxy) cache. |
IsClientConnected | |
Boolean | Property |
Returns an indication of whether the client is still connected to and loading the page from the server. Can be used to end processing (with the Response.End method) if a client moves to another page before the current one has finished executing. |
PICS | |
String | Property |
Write only. Create a PICS header and adds it to the HTTP headers in the response. PICS headers define the content of the page in terms of violence, sex, bad language, etc. |
Status | |
String | Property |
Read/write. Specifies the status value and message that will be sent to the client in the HTTP headers of the response to indicate an error or successful processing of the page. For example "200 OK" and "404 Not Found". |
AddHeader("name","content") | |
Method | |
Creates a custom HTTP header using the name and content values and adds it to the response. Will not replace an existing header of the same name. Once a header has been added, it cannot be removed. Must be used before any page content (i.e. text and HTML) is sent to the client. |
AppendToLog("string") | |
Method | |
Adds a string to the end of the Web server log entry for this request when W3C Extended Log File Format is in use. Requires at least the URI Stem value to be selected in the Extended Properties page for the site containing the page. |
BinaryWrite(SafeArray) | |
Method | |
Writes the content of a Variant-type SafeArray to the current HTTP output stream without any character conversion. Useful for writing non-string information such as binary data required by a custom application or the bytes to make up an image file. |
Clear() | |
Method | |
Erases any existing buffered page content from the IIS response buffer when Response.Buffer is True. Does not erase HTTP response headers. Can be used to abort a partly completed page. |
End() | |
Method | |
Stops ASP from processing the page script and returns the currently created content, then aborts any further processing of this page. |
Flush() | |
Method | |
Sends all currently buffered page content in the IIS buffer to the client when Response.Buffer is True. Can be used to send parts of a long page to the client individually. |
Redirect("url") | |
Method | |
Instructs the browser to load the page in the string url parameter by sending a "302 Object Moved" HTTP header in the response. |
Write("string") | |
Method | |
Writes the specified string to the current HTTP response stream and IIS buffer so that it becomes part of the returned page. |