ASP Tutorials - Herong's Tutorial Examples - v5.10, by Dr. Herong Yang
Controlling Response Header Lines
This section describes 2 ways to control HTTP response header line in an ASP script page: Using response.ContentType and response.Charset properties; and using response.AddHeader() method.
When an ASP page is requested, the response header lines will be created by the ASP server. But you can indirectly control some header lines in 2 different ways:
1. Modifying two special properties of the "response" object to set the entity header line Content-Type as shown in the following example:
response.ContentType = "text/plain" response.Charset = "ISO-8859-1"
These two statements will generate the following header line:
Content-Type: text/html; Charset=ISO-8859-1
2. Using the generic method on the "response" object to add any response header lines as shown in the following example:
response.AddHeader "Author", "Herong Yang"
There seems to be no SetHeader method on the response to let you reset the default header lines generated by the ASP server. You can only add new header lines.
Table of Contents