4b0
4b0

Reputation: 22323

Request.QueryString in asp.net

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);

Upvotes: 0

Views: 1616

Answers (2)

BrunoLM
BrunoLM

Reputation: 100381

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.

Upvotes: 1

Related Questions