ASP HTMLEncode 方法
定义和用法
HTMLEncode 方法对一段指定的字符串应用 HTML 编码。
语法
Server.HTMLEncode(string)
| 参数 | 描述 | 
|---|---|
| string | 必需。要编码的字符串。 | 
实例
脚本:
<%
response.write(Server.HTMLEncode("The image tag: <img>"))
%>
输出:
The image tag: <img>
浏览器的输出:
The image tag: <img>
HTMLEncode 方法对一段指定的字符串应用 HTML 编码。
Server.HTMLEncode(string)
| 参数 | 描述 | 
|---|---|
| string | 必需。要编码的字符串。 | 
脚本:
<%
response.write(Server.HTMLEncode("The image tag: <img>"))
%>
输出:
The image tag: <img>
浏览器的输出:
The image tag: <img>