1

I have created below route to accept any value in last parameter but it's not working.

routes.MapRoute(
    "My Route", // Route name
    "Home/MyMethod/{LID}/{MID}/{JID}/{*Title}", // URL with parameters
    new { controller = "Home", action = "MyMethod" } 
);

I want to accept a route like

http://localhost:10537/Home/MyMethod/47518/QQEBH/T2776086/8758~!@#$%^*()-+=-HAMPDEN--DR-TAMPA-FL-33626

A working sample is stackoverflow itself.

http://stackoverflow.com/questions/28695240/how-to-show-american-sign-language-hand-&*%3E%3C:signs-on-ios-keyboard-keys/28695997?noredirect=1#comment51236176_28695997

You can see in above URL, it's accepting &*><: etc symbols. Any help would be appreciable.

Jitendra Pancholi
  • 7,897
  • 12
  • 51
  • 84

1 Answers1

0

After a search, I found the solution

<system.web>
    <httpRuntime requestPathInvalidCharacters="" requestValidationMode="2.0" />
    <pages validateRequest="false" />
</system.web>

Ref:- Getting "A potentially dangerous Request.Path value was detected from the client (&)"

Community
  • 1
  • 1
Jitendra Pancholi
  • 7,897
  • 12
  • 51
  • 84