ASP.Net 4.0 Validate Request

When creating a CMS sometimes you need to allow certain tags pass through the ASP.Net Validation. To allow tags be posted, in v2.0, you had to include the following tag in the page directive:

ValidateRequest="false"

But in .Net 4.0, this is not enough. You also need to include the next tag (httpRuntime) in the web.config file under <system.web>:

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

There is also other information on Error validation in .Net 4.0 here

Resources: here

Categories

No Responses

Leave a Reply

Your email address will not be published. Required fields are marked *