The URLEncode method applies URL encoding rules, including escape characters, to a specified string.
Server.URLEncode(string)
string | Specifies the string to encode. |
The following script
<%Response.Write(Server.URLEncode("http://www.microsoft.com")) %>
produces the output
http%3A%2F%2Fwww%2Emicrosoft%2Ecom