ASP 콘텐츠 유형 속성
❮ 완전한 응답 객체 참조
ContentType 속성은 응답 개체에 대한 HTTP 콘텐츠 형식을 설정합니다.
통사론
response.ContentType[=contenttype]
Parameter | Description |
---|---|
contenttype | A string describing the content type.
For a full list of content types, see your browser documentation or the HTTP specification. |
예
ASP 페이지에 ContentType 속성이 설정되지 않은 경우 기본 콘텐츠 유형 헤더는 다음과 같습니다.
content-type:text/html
기타 일반적인 ContentType 값:
<%response.ContentType="text/HTML"%>
<%response.ContentType="image/GIF"%>
<%response.ContentType="image/JPEG"%>
<%response.ContentType="text/plain"%>
이 예에서는 브라우저에서 Excel 스프레드시트를 엽니다(사용자가 Excel을 설치한 경우).
<%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>
❮ 완전한 응답 객체 참조