1818IP-服务器技术教程,云服务器评测推荐,服务器系统排错处理,环境搭建,攻击防护等

当前位置:首页 - 网站技术 - asp - 正文

君子好学,自强不息!

asp的ContentType属性如何使用

2022-03-18 | asp | 1818ip | 443°c
A+ A-

标签含义:

ContentType 属性为 response 对象设置 HTTP 内容类型。

实例说明:

如果 ASP 页面没有设置 ContentType 属性,那么默认的 content-type 头部是这样的:

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>


本文来源:1818IP

本文地址:https://www.1818ip.com/post/461.html

免责声明:本文由用户上传,如有侵权请联系删除!

发表评论

必填

选填

选填

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。