private void cmdOK_Click(object sender, System.EventArgs e) { EncryptedQueryString queryString = new EncryptedQueryString((Rijndael)HttpContext.Current.Application["Key"]); queryString["testValue1"] = "This is a sample string."; queryString["testValue2"] = "6171742"; queryString["TextBox"] = txtData.Text; // Note that when redirecting, all the values become a single // encrypted query string argument. Response.Redirect("SecureQueryStringRecipient.aspx?data=" + queryString.ToString()); }
private void Page_Load(object sender, System.EventArgs e) { EncryptedQueryString queryString = new EncryptedQueryString( (Rijndael)HttpContext.Current.Application["Key"], Request.QueryString["data"]); StringBuilder sb = new StringBuilder(); foreach (DictionaryEntry item in queryString) { sb.Append("Found "); sb.Append(item.Key); sb.Append(" = "); sb.Append(item.Value); sb.Append("<br>"); } lblInfo.Text = sb.ToString(); }