0

Sorry if this has been asked before, but I couldn't find a solution to this problem.

My route is defined as a/{param1}/{param2}/{param3}/{param4}/{param5}.

Everything works when the parameters are simply words, but when any of the parameter look like someword%2bsomeotherword, everything breaks and the route isn't matched. If I remove the %2b, then the route is resolved.

This is the first route registered, so I don't think it's finding a better route first.

Sorry if this is answered somewhere, but I have gone through a bunch of SO answers and other links. Routes in MVC have always eluded me.

Thank you for any help.

Kolichikov
  • 2,780
  • 28
  • 42
  • Did you see this post: http://stackoverflow.com/questions/9373642/how-to-deal-in-asp-net-mvc3-routes – amrinea May 19 '17 at 20:48
  • I have. It causes a "potentially unsafe request" exception. I should have mentioned that this happens on iisexpress as well, not just on iis. – Kolichikov May 19 '17 at 20:53
  • use "requestPathInvalidCharacters" maybe Take a look at : http://stackoverflow.com/questions/14009618/how-do-i-enable-special-characters-in-mvc-routing – salah-1 May 19 '17 at 21:07
  • I'm not sure why it breaks it without creating a sample solution. Could you change your parameters to be querystring values instead? It seems like a lot of parameters to be strung together. – amrinea May 20 '17 at 00:54

0 Answers0