The HTMLEncode method ensures that any HTML, or text that appears similar, will be output to the page as it appears and will not be interpreted by the browser as HTML. (Returns String.)
Set Text = Server.HTMLEncode (Str)
To avoid the browser confusing HTML code with text that has HTML elements in it, always use this method before writing text that contains special HTML characters to the page.
For example, consider the following line:
Response.Write HTMLEncode("<B>This is not bold</B>")
The browser will display this line like so:
However, the following line of code will produce a different result.
Response.Write "<B>This is bold</B>"
This line will be displayed like so:
Crystal Decisions, Inc. http://www.crystaldecisions.com Support services: http://support.crystaldecisions.com |