ASP » Server » HTMLEncode

Syntax:
Server. HTMLEncode (String)
String
The String argument is the string to be encoded.

The HTMLEncode method applies HTML syntax to a specified string of ASCII characters.

The HTMLEncode method applies HTML encoding syntax to a specified string of ASCII characters. For example, this allows you to display a HTML tag on a web page and not have it treated as an actual tag.

There is one mandatory argument.

Examples

Code:
<% Response.Write Server.HTMLEncode("The tag for a table is: <Table>") %>
Output:
The tag for a table is: &lt;Table&gt;
Explanation:

In a browser the output would look like this: The tag for a table is: <Table>

See Also: