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

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s