- Forums
- ASP
- How To Encode URL In ASP.NET
Encoding Url In Asp.net Script You Can Do It By Using The Server Urlencode Function [3658], Last Updated: Mon Jun 24, 2024
Webune Support
Tue Dec 08, 2009
0 Comments
949 Visits
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.htmlyou 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