Click here to Skip to main content
15,893,190 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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

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
 
Share this answer
 
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, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900