Click here to Skip to main content
15,892,537 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello Friends,
Please Help Me To Sort Out This Error.


I Use a QueryString in Forgot Password Page.And Encrpt QuerYString Variable. The value Of variable after Encrption Is: 4FLybyAVijalWsLm5fGz1bdy2qPEDh/u5bGW5lE6bkgayF9VsT+OVGDWop7s8vNk

Code Is:
message.Body = "To reset your password, please click on the URL below. http://ShopingCart/Admin/ResetPassword.aspx?resource=4FLybyAVijalWsLm5fGz1bdy2qPEDh/u5bGW5lE6bkgayF9VsT+OVGDWop7s8vNk[^]


Resetpassword.aspx:

if (Request.QueryString["resource"] != null )
{
String DecrptEmailId = Request.QueryString["resource"].ToString();

string EmailId = BusinessClassObject.Decrypt(DecrptEmailId);
Label1.Text=EmailId;
}

Now At The Time Of Receiving The Varaible Value is:
4FLybyAVijalWsLm5fGz1bdy2qPEDh/u5bGW5lE6bkgayF9VsT OVGDWop7s8vNk

Varaible Value Modified Automatically.
'+' Sign Modified By a space.

Due To This I Got A error At The Time of Decrption.
Posted
Updated 31-Aug-15 2:52am
v2

1 solution

When you generate the url, use Server.UrlEncode on the encrypted value because you have a few special characters that need encoded.

C#
url += "?resource=" + Server.UrlEncode(someVar);


Request.QueryString automatically decodes it so you don't need to do any change there.
 
Share this answer
 
v2
Comments
aarif moh shaikh 31-Aug-15 8:59am    
agree with you
Member 11804811 31-Aug-15 9:21am    
Thankyou
ZurdoDev 31-Aug-15 9:59am    
You're welcome.
Member 11804811 1-Sep-15 6:49am    
After Using Server.UrlEncode it becomes
http://localhost:63012/Admin/ResetPassword.aspx?resource=ram%40gmail.com
It isd not fully encrypted rather it adds some special character
ZurdoDev 1-Sep-15 7:10am    
It's encoded, not encrypted. Big difference. It changes special characters, such as the "@" into characters that are valid in the url.

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