0

My code is work well but i want to send "Item" and "Mode" in encrypted form.any built in method in asp?if not plz suggest alternative solution.

string url = "QueryStringRecipient.aspx?";
url += "Item=" + lstItems.SelectedItem.Text + "&";
url += "Mode=" + chkDetails.Checked.ToString();
Response.Redirect(url);
4b0
  • 21,981
  • 30
  • 95
  • 142

2 Answers2

1

Encrypted or encoded?

To encode strings there is HttpServerUtility.UrlEncode

public string UrlEncode(
    string s
)

Parameters

s
    Type: System.String
    The text to URL-encode.

Return Value

Type: System.String
The URL-encoded text.

To decode HttpServerUtility.UrlDecode

public static string UrlDecode(
    string str
)

Parameters

str
    Type: System.String
    The string to decode.

Return Value

Type: System.String
A decoded string.
BrunoLM
  • 97,872
  • 84
  • 296
  • 452