Tuesday, September 13, 2011

URL Encode and Decode in asp.net

Using HTML Encode and Decode

string text="This is Encode and Decode program";

To Encode
Server.HtmlEncode(text);

To Decode
Server.HtmlDecode(text);

Using ASP.NET Encode and Decode

To Encode
HttpServerUtility.UrlEncode(text);

To Decode
HttpServerUtility.UrlDecode(text);


No comments:

Post a Comment