PDA

View Full Version : URLEncode and HTMLEncode


admin
05-29-2003, 03:39 PM
URLEncode applies URL encoding rules, including escape characters, to a specified string:

Example: <%Response.Write(Server.URLEncode("http://www.programmersresource.com"))%>
Produces: "http%3A%2F%2Fwww%2Eprogrammersresource%2Ecom"

HTMLEncode converts special characters to their HTML syntax for ASCII characters:

Example: <%=Server.HTMLEncode("The Paragraph Tag: <P>")%>
Produces: "The Paragraph Tag: &lt;P&gt;"