3

If I pass a string as a parameter to Url.Encode, .NET chooses not to url encode the character.

So...

Url.Action("A", "C", new { id = "1*1" }

...would create the url http://mysite/C/A/1*1

However, clicking this link causes .NET to reject the parameter and throws the exception...

A potentially dangerous Request.Path value was detected from the client (*).

If I change the URL (in chrome) to a url encoded version...

http://mysite/C/A/1%2A1

... if still throws the same error?

How can I ensure the URLs created by .NET on one page are allowed on another page?

Beakie
  • 1,948
  • 3
  • 20
  • 46

0 Answers0