0

I just sent my application URL to user in email with query sting contains different variable with values just see below. As it can be seen I just encrypt the values of variables. He needs to click URL and come to my application this is the scenario.

http://225.XXX.206.XX/VendorInvoiceApprovalService?InvoiceRecIdString=M2r4iw/MewTIIw01YS4Cpg==&UserId=r13jfB8PDQ2hLtq8vTh32g==&EmailId=GZfCFBZLRF/wh+sqkeEYoGqrdGU22oh9sS2a1fDy4FqmArda9/CvG5lsL8/LitJY&Company=3LIHJYmHQc92ULjj1JXIhw==

But when I got these query string in my C# code like I have issue in Email value.

EmailId=GZfCFBZLRF/wh+sqkeEYoGqrdGU22oh9sS2a1fDy4FqmArda9/CvG5lsL8/LitJY 

this is actual value

but when I use below line of code + sign is being replaced with space.

string email = Request.QueryString["EmailId"];
GZfCFBZLRF/wh sqkeEYoGqrdGU22oh9sS2a1fDy4FqmArda9/CvG5lsL8/LitJY  

in above line + sign is being replaced with space.

How could I get my query string value without any change. Already used

Server.UrlEncode(Request.QueryString["EmailId"])

It corrects the space issue and provide the + but replacing / with % so another issue is being created.

So please provide the solution.

Olivier Jacot-Descombes
  • 104,806
  • 13
  • 138
  • 188

1 Answers1

0

To use special characters you should use UrlEncode and UrlDecode

HttpUtility.UrlEncode(value);
Amjad S.
  • 1,196
  • 1
  • 4
  • 16