ASP HTMLEncode 屬性
定義和用法
HTMLEncode 方法對一段指定的字符串應用 HTML 編碼。
語法
Server.HTMLEncode(string)
參數 | 描述 |
---|---|
string | 必需。要编码的字符串。 |
实例
脚本:
<% response.write(Server.HTMLEncode("The image tag:")) %>
输出:
The image tag: <img>
浏览器的输出:
The image tag:![]()
HTMLEncode 方法對一段指定的字符串應用 HTML 編碼。
Server.HTMLEncode(string)
參數 | 描述 |
---|---|
string | 必需。要编码的字符串。 |
脚本:
<% response.write(Server.HTMLEncode("The image tag:")) %>
输出:
The image tag: <img>
浏览器的输出:
The image tag:![]()