ASP ContentType Eiendom


❮ Voltooi reaksie-objekverwysing

Die ContentType-eienskap stel die HTTP-inhoudtipe vir die responsobjek.


Sintaksis

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.


Voorbeelde

As 'n ASP-bladsy geen ContentType-eienskapstel het nie, sal die verstek inhoudtipe-opskrif wees:

content-type:text/html

Sommige ander algemene ContentType-waardes:

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

Hierdie voorbeeld sal 'n Excel-sigblad in 'n blaaier oopmaak (as die gebruiker Excel geïnstalleer het):

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

❮ Voltooi reaksie-objekverwysing