How To Encode URL In ASP.NET

RegisterLogin
How To Encode URL In ASP.NET
Post Description: Encoding Url In Asp.net Script You Can Do It By Using The Server Urlencode Function
Tags: how, To, Encode, Url, In, Asp.net
This Post Was Posted On Dec 08, 2009 By Webune Support #2879
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



Leave Your Comments
Related Pages: [Add Your Website]
Post New Topic
©2012 Webune Forums - Wed Dec 12, 2012 5:54 pm
Powered by: Webune Forums V3