tags:

views:

98

answers:

3

How to encrypt and decrypt the Query string and sent,receive to another page?

Page 1

LinkButton InvoiceEdit = sender as LinkButton;
string EditId = InvoiceEdit.CommandArgument.ToString();
Response.Redirect("edit invoice.aspx?EditId=" + EditId);

Page 2

String invoiceId = Request.QueryString["InvoiceId"].ToString();
A: 

I guess you wanna change editid but some value NOT-Changed after editid changed. I think you can use viewstate to help.

Weixiao.Fan
+1  A: 

Sorry I don't know what's your exact issue. But here I should say:

  1. Do not put those financial related parameters in the query string.

  2. Do you mean that when you change the URL in the browser from xx.aspx?editid=5 to xx.aspx?editid=4, the invoice in your page also changes? The reason is, editid=4 means the invoice you loaded is the one whose id is 4 while editid=5 will display the invoice whose id is 5. If you want to get the same result when browsing editid=4 and editid=5, just make the two invoices same. haha

Danny Chen
+1  A: 

Your question is not clear. what i understand that seems u want to restrict user to modified url. you can user URL Referrer check on page load if Request.UrlReferrer.AbsoluteUri == null { Response.redirect("home page") }

If someone tried to modify url it will alway return null and you can redirect to home page or some other page to restrict the user.

Harendra
thanks man this is wt i expect
Ayyappan.Anbalagan