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