ASP HTMLEncode 方法

HTMLEncode 方法對一段指定的字串應用 HTML 編碼。
語法
Server.HTMLEncode(string)
參數 | 描述 |
---|---|
string | 必需。要編碼的字串。 |
實例
腳本:
<%
response.write(Server.HTMLEncode("The image tag: <img>"))
%>
輸出:
The image tag: <img>
Web 流覽器輸出:
The image tag: <img>
<%
response.write(Server.HTMLEncode("The image tag: <img>"))
%>
輸出:
The image tag: <img>
Web 流覽器輸出:
The image tag: <img>
