Click here to Skip to main content
14,423,678 members
Rate this:
Please Sign up or sign in to vote.
See more:
hi,

am developing web application,when i redirect from one web page to another webpage
query string is displyed with all the parameters.

Eg:
Collapse | Copy Code
Response.Redirect("~/User.aspx?UserName=" + txtuser.Text.Replace("&", "%26") +
"&Password=" + txtpwd.Text.Replace("&", "%26"));

in the querystring it's displying username and password.

but password don't apper on query string in browser


How to solve it.
Posted

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

Simple you can use encrypt and decrypt method for this.

While passing parameters to second page just do encrupty the username and password and send to another page.
And in another page just use same decrypt algorithm to get original values of username and password.

For symmetric encryption, check out the MSDN doc and examples:

System.Security.Cryptography.Aes
System.Security.Cryptography.DES
System.Security.Cryptography.RC2
System.Security.Cryptography.Rijndael
System.Security.Cryptography.TripleDES

For asymmetric encryption, check out the MSDN doc and examples:

System.Security.Cryptography.DSA
System.Security.Cryptography.ECDiffieHellman
System.Security.Cryptography.ECDsa
System.Security.Cryptography.RSA


If you do not want to visible that decrypted value,then just stored the values in session variable.But here you need to be carefull for session handling
   
Comments
Member 10263519 28-Jan-14 5:05am
   
thaks for reply

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100