how to encode/decode plain text in .net.

 [Ajax.AjaxMethod(Ajax.HttpSessionStateRequirement.ReadWrite)]
public string encodetext(string plaintext)
{
return WebUtility.HtmlEncode(plaintext);
}

[Ajax.AjaxMethod(Ajax.HttpSessionStateRequirement.ReadWrite)]
public string decodetext(string encodedtext)
{
return WebUtility.HtmlDecode(encodedtext);
}

 

 

SHARE THIS

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.