Reputation: 12695
let's way that one of my controller's action gets - as a parameter - an encrypted string. A problem is, that when the URL looks
MyAccount/Activate/?code=DbXQ2SQiwYYiDhC+ahAppa23P95YifE2z6uyvnhWCFE=
the 'code' parameter in that action looks like:
DbXQ2SQiwYYiDhC ahAppa23P95YifE2z6uyvnhWCFE=
(the "+" char is missing)
why ?
Upvotes: 1
Views: 573
Reputation: 35117
URLs are URL encoded and + is interpreted as a space. Use the Server.UrlEncode() method to encode your encrypted string prior to passing it through the querystring.
Or if this encrypted string is coming from the client side you'll need to use javascript to encode the data. I'm sure there's dozens of articles about the web on how to do this. Here's one example: http://plugins.jquery.com/project/URLEncode
Upvotes: 3
Reputation: 13483
You need to URL encode the code parameter in the GET string. It should be
MyAccount/Activate/?code=DbXQ2SQiwYYiDhC%2bahAppa23P95YifE2z6uyvnhWCFE%3d
Upvotes: 1