Response| Object | Explain each program language or development tool has a certain function to communicate with the user, ASP same. The object that is responsible for passing information to the user in the ASP is the response object. The response object is used to dynamically respond to client requests and to return dynamically generated response results to the client browser, using the response object to send information directly to the browser, redirect the browser to another URL, or set the value of the cookie, and so on. The response object is very extensive in ASP programming and is also a very useful tool. Here's a concrete look at the response object:
Grammar:
Response.collection|property|method
One, set
Response objects have only one collection--cookies,cookies data sets allow data to be set in the client's browser. If the specified cookie does not exist, it is created. If present, the data is automatically updated.
Syntax: Response.Cookies (Cookie) [Key.attribute]
The cookie here is the name of the specified cookie. If a key is specified, the cookie is a dictionary. attribute specifies information about the cookie itself. Attribute parameters can be one of the following:
Domain write only. If specified, the cookie is sent to the request in the domain.
Expires only write. Specifies the expiration date for the cookie. To store cookies on the client disk after the session has ended, you must set the date. If the setting for this property does not exceed the current date, the cookie expires after the task ends.
HasKeys Read only. Specifies whether the cookie contains keywords.
Path is write only. If specified, the cookie is sent only to the request for that path. If this property is not set, the path to the application is used.
Secure only write. Specifies whether the cookie is safe.
Second, the method
Response.addheadername,value
Adds a new HTML caption to the answer. Name is the new HTML title. Value is the values of the header variable. You can add any name and any value to the HTML caption. It does not replace an existing title with the same name. Once the caption is added, it cannot be deleted.
Response.appendtologstring
Adds a string to the end of the log entry for the Web server. String to be added to the log file.
Response.binarywritedata
This method can write information to the HTTP output without any character conversion, and is mainly used to write information that is not string, such as binary data required by client applications, etc. Data is what you want to send.
Response.Clear
Deletes all HTML output from the buffer, but deletes only the response body without deleting the response header. You can use this method to handle error conditions. It should be noted that if Response.Buffer is set to True, this method will cause the run to be an error.
Response.End
Force the Web server to stop executing more scripts and send the current result, and the remaining content in the file will not be processed. If Response.Buffer is set to True, the call to Response.End will buffer the output.
Response.Flush
For a buffered response, send all the buffered information. If Response.Buffer is set to True, the method will cause the run to be an error.
Response.redirecturl
Redirects the client's browser to a new Internet address. The URL is the Internet address for the new page.
Response.writevariant
Response.Write is the most common method for Response objects, which can send strings to the browser. A variant is a string or a variable that has a string value.
Third, the property
Response.Buffer
Buffer a activeserverpage. Response only to a page end or Response.Flush or Response.End method call Chicai sent out. The server will not be able to set the buffer property after the output is sent to the client.
Response.CacheControl
Indicates whether the proxy server can cache activeserverpage. By default, its value is false. When you set its properties to public, the proxy server can buffer the output generated by the ASP.
Response.Charset (CharsetName)
Attaches a character set name (such as GB) to the response object, after the Content-type header, to set the file character encoding that the Web server responds to the client. One possible value is "iso_latin_1".
Response.ContentType
Indicates the type of response content. The possible values are Text/plain and image/gif, and the default value is text/html.
Response.Expires
The length of time, in minutes, that the browser can cache the current page.
Response.ExpiresAbsolute
The browser can no longer cache the date and time of the current page. Can be returned before it expires. If no time is specified, the home page expires at midnight on the same day, and if no date is specified, the specified time of day expires.
true/false=response.isclientconnected
property is read-only to indicate whether the client is still connected to the server since the last call to Response.Write. This property allows the user to have more control when the client and server are not joined. For example, this may help ensure that the client is still connected before proceeding with the script, when the request is made from the client and the server makes the appropriate use for a long period of time. Has a value of true or false.
Response.PICS (PICS string)
The pics level used to add pages. The pics level indicates the content level of a Web page, such as the degree of violence or pornography.
Response.status= "Status Description string"
The value used to set the status row for the Web server to respond to.