当前位置: 首页 > 网络学院 > 服务端脚本教程 > ASP > ASP ContentType 属性

ASP
ASP 介绍
ASP Install
ASP 语法
ASP 变量
ASP Procedures
ASP Forms
ASP Cookies
ASP Session
ASP Application
ASP #include
ASP Global.asa
ASP Send e-mail
ASP Response
ASP Request
ASP Application
ASP Session
ASP Server
ASP Error
ASP FileSystem
ASP TextStream

ASP ContentType 属性


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-04   浏览: 373 ::
收藏到网摘: n/a

The ContentType property sets the HTTP content type for the response object.
ContentType属性是为response对象设置HTTP content(内容)类型。

Syntax
语法

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(内容)类型的列表

Examples
举例

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>

评论 (0) All

登陆 | 还没注册?