tags:

views:

22

answers:

2

Hi, 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 ?

+1  A: 

You need to URL encode the code parameter in the GET string. It should be

MyAccount/Activate/?code=DbXQ2SQiwYYiDhC%2bahAppa23P95YifE2z6uyvnhWCFE%3d
villecoder
+3  A: 

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

Spencer Ruport