ASP ContentType Property
Complete Response object reference manual
The ContentType property sets the HTTP content type for the response object.
Syntax
response.ContentType[=contenttype]
| Parameters | Description |
|---|---|
| contenttype | A string describing the content type.
For a complete list of content types, see your browser documentation or the HTTP specification. |
Example
If the ASP page does not set the ContentType property, the default content-type header looks like this:
content-type:text/html
Some other commonly used ContentType values:
<%response.ContentType="text/HTML"%>
<%response.ContentType="image/GIF"%>
<%response.ContentType="image/JPEG"%>
<%response.ContentType="text/plain"%>
This example opens an Excel spreadsheet in the browser (if Excel is installed on the user's computer):
<%response.ContentType="application/vnd.ms-excel"%>
| 1 | 2 | 3 | 4 |
| 5 | 6 | 7 | 8 |
Complete Response object reference manual