Asp Object 之:ContentType
發表于:2007-07-14來源:作者:點擊數:
標簽:
ContentType ContentType 屬性指定響應的 HTTP 內容類型。如果未指定 ContentType ,默認為 text/HTML。 語法 Response.ContentType [ = ContentType ] 參數 ContentType 描述內容類型的字符串。該字符串通常被格式化為類型/子類型,其中類型是常規內容范疇
ContentType
ContentType 屬性指定響應的 HTTP 內容類型。如果未指定 ContentType,默認為 text/HTML。
語法
Response.ContentType [= ContentType ]
參數
- ContentType
- 描述內容類型的字符串。該字符串通常被格式化為類型/子類型,其中類型是常規內容范疇而子類為特定內容類型。有關支持內容類型的完整列表,請參閱 Web 瀏覽器文檔或當前的 HTTP 規格說明。
示例
下面的示例將內容類型設置為 Channel Definition Format(CDF)。
<% Response.ContentType = "application/x-cdf" %>
下面的示例將 ContentType 屬性設置為其他的常見值。
<% Response.ContentType = "text/HTML" %><% Response.ContentType = "image/GIF" %><% Response.ContentType = "image/JPEG" %>
應用于
Response 對象
原文轉自:http://www.kjueaiud.com