Use of UrlEncode and UrlDecode Method in Asp.net
UrlEncode Method :
HttpUtility.UrlEncode(string)
Ex:
string encodedText= HttpUtility.UrlEncode(txtrefcode.Text.Trim())
string url = “Test.aspx?enc=” + encodedText;
Response.Redirect(url);
UrlDecode Method :
HttpUtility.UrlDecode(Encoded String);
Ex:
string decodeValue = HttpUtility.UrlDecode(Request.QueryString[“enc”]);