1

I want to use encrypted strings in MVC2 urls. A typical url in my app looks like this:

http://localhost:29558/Account/PasswordReset/ZKGeDMZikfIsnO8/MEs7SCBlI+MZo1Je8LM5dTEeCt3u91ARPUcavT5UXfVVRfyE

Note that everything after PasswordReset/ is the encrypted string. In the example the encrypted string contains a slash, and this is causing MVC to crash.

I've tried adding a MapRoute in Global.asax.cs as follows:

routes.MapRoute(
                "PasswordResetSpecialCase", // Route name
                "Account/PasswordReset/*", // URL with parameters
                new { controller = "Account", action = "PasswordReset" } // Parameter defaults
            );

but MVC2 is still falling over because the encrypted string contains a slash char. If I remove the slash then it works, but obviously that's no good. How do I get MVC2 to regard everything after the PasswordReset as pure data? Thanks.

Journeyman
  • 10,011
  • 16
  • 81
  • 129

1 Answers1

1

Your maproute contains an error. Replace the * with {*nameOfParameter}

ZippyV
  • 12,540
  • 3
  • 37
  • 52