propriété ASP ContentType
propriété ContentType est réglé sur HTTP type de contenu de l'objet de réponse.
grammaire
response.ContentType[=contenttype]
参数 | 描述 |
---|---|
contenttype | 描述内容类型的字符串。
如需完整的内容类型列表,请参阅您的浏览器文档或 HTTP 规范。 |
Exemples
Si la page ASP est pas défini la propriété ContentType, puis l'en-tête de type de contenu par défaut comme ceci:
content-type:text/html
Quelques autres ContentType valeurs communes:
<%response.ContentType="text/HTML"%>
<%response.ContentType="image/GIF"%>
<%response.ContentType="image/JPEG"%>
<%response.ContentType="text/plain"%>
<%response.ContentType="image/GIF"%>
<%response.ContentType="image/JPEG"%>
<%response.ContentType="text/plain"%>
Cette réunion régulière ouvrir une feuille de calcul Excel (si vous avez installé Excel) dans votre navigateur:
<%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>
<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>
Complete Response Object Reference