Search code examples
asp.netasp.net-4.0validate-request

ValidateRequest="false" doesn't work in Asp.Net 4


I have a form at which I use ckeditor. This form worked fine at Asp.Net 2.0 and 3.5 but now it doesn't work in Asp.Net 4+. I have ValidateRequest="false" directive. Any suggestions?


Solution

  • Found solution on the error page itself. Just needed to add requestValidationMode="2.0" in web.config

    <system.web>
        <compilation debug="true" targetFramework="4.0" />
        <httpRuntime requestValidationMode="2.0" />
    </system.web>
    

    MSDN information: HttpRuntimeSection.RequestValidationMode Property