I used this method in class library and calling the method from controller. But the value i passed is not encoding. I cant trace the reason behind it.
Class Library
using System.Web;
public static class CommonLogic
{
public static string UrlEncode(string value)
{
return HttpUtility.UrlEncode(value);
}
}
Controller
var test = CommonLogic.UrlEncode("2")
test value is "2" and it not encoded.
Update:
I just realized the reason from comments below. What i really need is not encoding but encryption and decryption. I don't want the Url parameters to be exposed as plain text, instead i want that to be encrypted value and later in controller i will decrypt it again before processing that value. Any Ideas on this?