To encode a URL using ASP.NET you can use the Server.URLEncode() object.

for example, lets say i have this url:
http://www.webune.com/forums/wow-to-encode-url-in-aspnet.html

you can encode it like this using this example script:
ASP CODE:
<%
EncodedUrl = Server.URLEncode(http://www.webune.com/forums/wow-to-encode-url-in-aspnet.html)

response.Write(EncodedUrl)
%>


the ouput would look like this:


http%3A%2F%2Fwww%2Ewebune%2Ecom%2Fforums%2Fwow%2Dto%2Dencode%2Durl%2Din%2Daspnet%2Ehtml