Unveil ASP Mystery (3)

Source: Internet
Author: User
Response
    
Author: mi Xiansheng
    
In contrast to the Request (Request is used to obtain the HTTP information of the client), the Response object is used to control the information sent to the user, this includes sending information directly to the browser, redirecting the browser to another URL, or setting the cookie value.
    
Syntax
Response. collection | property | method
    
I. Attributes
1. Buffer attributes
The Buffer attribute indicates whether to Buffer page output. When the buffer page is output, the server sends the response to the client browser only after all the server scripts on the current page are processed or the Flush or End method is called, after the server sends the output to the client browser, the Buffer attribute cannot be set. Therefore, Response. Buffer should be called in the first line of the. asp file.
2. Charset attributes
The Charset attribute attaches the character set name to the end of the content-type title in the Response object. For ASP pages that do not contain the Response. Charset attribute, the content-type title is: content-type: text/html.
You can specify the content-type title in the. asp file, for example:
<% Response. Charset = "gb2312") %>
The following results are generated:
Content-type: text/html; charset = gb2312
Note: This function inserts a string into the content-type title regardless of whether the character set is valid. If a page contains multiple tags containing Response. Charset, each Response. Charset replaces the previous CharsetName. In this way, the character set is set to the value specified by the last instance of Response. Charset on this page.
    
3. ContentType attributes
The ContentType attribute specifies the HTTP content type of the server response. If ContentType is not specified, the default value is text/HTML.
    
4. Expires attributes
The Expires attribute specifies the time before the page cached on the browser Expires. If you return to this page before a page expires, the page in the buffer zone is displayed. If response. expires is set to 0, the cached page can expire immediately. This is a more practical attribute. When you enter the WEB site through ASP login page, you should use this attribute to immediately expire the login page to ensure security.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.