Link:http://output.to/sideway/default.asp?qno=120200004 PICS / AddHeader Response ObjectAnother important function of Response object is the output of HTTP headers to the client. As part of the HTTP header, these types of response objects should be sent before sending any body content to the client. Response.PICS PropertyResponse.PICS property sets the value of PICS label for the pics-label header to specify the content rating. PICS (Platform for Internet Content Selection) was designed to label or to rate the content Syntax:Response.PICS (PICSLabel) Or in an ASP file. Imply <% Response.PICS = PICSLabel %> Parameters:PICSLabel The parameter "PICSLabel" is the content rating of a page. The data type of "PICSLabel" is string of the form formatted PICS label. Remarks:There is no mechanism to validate whether the specified value represents a valid PICS label or not. The value of PICSLabel must be enclosed in quotation marks (" ") and therefore the quotes in PICS label must be placed by chr(34) If there are multiple Response.PICS in the same page, the last instance of Response.PICS in the HTTP header setting of a ASP file will replace all previous Response.PICS Setting?. Examples:
Response.AddHeader MethodResponse.AddHeader Method adds a new HTTP header with name "HeaderName" and sets the value to "HeaderValue". Syntax:AddHeader( Or in an ASP file. Imply <% Response.AddHeader "HeaderName", "HeaderValue" %> Parameters:HeaderName The parameter "HeaderName" is the name of added header. The data type of "HeaderName" is string and the value must be enclosed within quotation signs (" "). HeaderValue The parameter "HeaderValue" is the value of added header. The data type of "HeaderValue" is string and the value must be enclosed within quotation signs (" "). Return Values:This method has no return values. Remarks:The Response.AddHeader Method always append the added header to the HTTP header. The value of the added header does not replace any existing header with the same name. The values of the parameters must be enclosed in quotation marks (" "). The customer header value can be retreived by Request.ServerVariables by adding "HTTP_" to the beginning of the custom header name if the client is configured to return response header to the server on a subsequent request. Therefore the retriving of the customer header value is highly depending on the configuration of the client and this method should be avoided if other method can provide the funcionality as required. Since the ServerVariables collection interprets underscores as dashes in the header name, the HeaderName should not contain any underscore (_) characters to avoid name ambiguity. As the HTTP header should send before the HTML output, if the response buffer is not enbled in IIS 4.0, all Response.AddHeader method should run before sending any response to client. IN IIS 5.0 or later, the response buffer is enabled by default, all Response.AddHeader method should run before calling Response.Flush method to sent the response to the client. Examples:
|
Sideway BICK Blog 02/02 |