25. November 2010 11:50 by nolovelust
Since I started to develop with .Net 4 something was bugging me. I was unable to disable Request Validation like on 2. There is option on .Net 4 that you can set it .Net 2 model with
So that you can enable/disable validation on page level. But, if you are using .Net 4 WebForms Routing sometimes you end up with errors like
A potentially dangerous Request.Path value was detected from the client
Although it is good thing to filter out dangerous requests in my case i need to have them present in the url.
There is a simple solution for it. You just need to set HttpRuntimeSection.RequestPathInvalidCharacters Property as you like. Default illegal chars are "<,>,*,%,&,:,\,?".
You can change them in your web.config. Here is my perefered settings
<httpRuntime requestValidationMode="2.0" requestPathInvalidCharacters="*,:" />
For more info read