Latest web development tutorials

Obiekt ASP ContentType

Response Reference Object Całkowita odpowiedź Object Reference

Obiekt ContentType jest ustawiona na HTTP Content typ dla obiektu odpowiedzi.

gramatyka

response.ContentType[=contenttype]

参数 描述
contenttype 描述内容类型的字符串。

如需完整的内容类型列表,请参阅您的浏览器文档或 HTTP 规范。

Przykłady

Jeśli strona ASP nie jest ustawiona właściwość ContentType, wówczas domyślny typ zawartości nagłówka tak:

content-type:text/html

Niektóre inne wspólne contenttype wartości:

<%response.ContentType="text/HTML"%>
<%response.ContentType="image/GIF"%>
<%response.ContentType="image/JPEG"%>
<%response.ContentType="text/plain"%>

To regularne spotkania otwarciu arkusza kalkulacyjnego Excel (jeśli masz zainstalowany program Excel) w przeglądarce:

<%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>


Response Reference Object Całkowita odpowiedź Object Reference