I have a bunch of images that contain ampersands in their names. My site is built on Asp.net MVC3.
When I try to view the image with they urls below my site returns and error.
Example urls:
Error returned: A potentially dangerous Request.Path value was detected from the client (&).
Is there away around this issue? I dont really want to turn off validation or revert to requestValidationMode="2.0" as i've seen suggested as this is only an issues with some images.
All the images are in the same folder (myimages), is it possible to stop validation on a particular folder?
I was able to fix this by making the following addition to the Web.config
<httpRuntime requestPathInvalidCharacters="<,>,*,%,:,\,?" />
All that was removed was the &
. I learned this by narrowing down which parts of this post were required to fix the problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With