Monday 16 April 2012

How can we send encypted data using querystring in asp.net

We usually pass value through query string of the page and then this value is pulled from Request object in another page.

FirstForm.aspx.cs

Response.Redirect(“SecondForm.aspx?item1=” + TextBox1.Text);

SecondForm.aspx.cs

TextBox1.Text = Request. QueryString["item1"].ToString();

After Encryption Send data using query string in asp.net


FirstForm.aspx.cs

Response.Redirect(“SecondForm.aspx?item=” + Server.UrlEncode(TextBox1.Text));

SecondForm.aspx.cs

TextBox1.Text = Server.UrlDecode(Request.QueryString["item"].ToString());

So, its a secure way to send information to one page to another page using query string.

No comments:

Post a Comment