The HTMLEncode method applies HTML encoding to a specified string.
Server.HTMLEncode( string )
The following script
<%= Server.HTMLEncode("The bold tag: <B>") %>
Produces the output:
The bold tag: <B>
Server Object
URLEncode