How do I allow inline images with data urls on .NET 4 without triggering request validation?
Posted
by Johan Driessen
on Stack Overflow
See other posts from Stack Overflow
or by Johan Driessen
Published on 2010-03-18T18:57:12Z
Indexed on
2010/03/18
20:01 UTC
Read the original article
Hit count: 400
I'm using the jQuery jstree plugin (http://jstree.com) in a ASP.NET MVC 2 project on .NET 4 RC. It comes with some stylesheets with inline images with data urls, like this:
.tree-checkbox ul { background-image:url(data:image/gif;base64,R0lGODlhAgACAIAAAB4dGf///yH5BAEAAAEALAAAAAACAAIAAAICRF4AOw==); }
Now, the url for the background image contains a colon, which .NET 4 thinks is an unsafe character, so I get this error message:
A potentially dangerous Request.Path value was detected from the client (:).
According to the documentation, I am supposed to be able to prevent this by adding
<pages validateRequest="false" />
to my Web.config, but that doesn't seem to help. I have tried adding it to the main Web.config for the application, as well as to a special Web.config in the /config folder, but to no avail.
Is there any way to get .NET to allow this?
© Stack Overflow or respective owner