当前位置: 首页 > 网络学院 > 服务端脚本教程 > ASP > ASP ContentType 属性
The ContentType property sets the HTTP content type for the response object.
ContentType属性是为response对象设置HTTP content(内容)类型。
response.ContentType[=contenttype] |
Parameter 参数 | Description 描述 |
---|---|
contenttype | A string describing the content type. 描述content(内容)类型的字符串 For a full list of content types, see your browser documentation or the HTTP specification. 你可以通过查看浏览器文件或参阅HTTP规则来获取所有的content(内容)类型的列表 |
If an ASP page has no ContentType property set, the default content-type header would be: content-type:text/html Some other common ContentType values: <%response.ContentType="text/HTML"%> <%response.ContentType="image/GIF"%> <%response.ContentType="image/JPEG"%> <%response.ContentType="text/plain"%> <%response.ContentType="image/JPEG"%> This example will open an Excel spreadsheet in a browser (if the user has Excel installed): <%response.ContentType="application/vnd.ms-excel"%> <html> <body> <table> <tr> <td>1</td> <td>2</td> <td>3</td> <td>4</td> </tr> <tr> <td>5</td> <td>6</td> <td>7</td> <td>8</td> </tr> </table> </body> </html> |