Disable Event Validation in SharePoint

28 Nov

So you developed a slick MOSS webpart, but you do some fancy AJAX and the ASP.Net event validation system is throwing exceptions for you?

Sometimes it isn’t practical/possible to register all your values for event validation with the clientscriptmanager, and you just need to disable the feature.

Open up your sharepoint web.config, and search for  “<Page”

Add a new attribute to the tag, enableEventValidation=”false”

It should now look something like this:

    <span class="kwrd">&lt;</span><span class="html">pages</span> <span class="attr">enableSessionState</span><span class="kwrd">="false"</span> <span class="attr">enableViewState</span><span class="kwrd">="true"</span> <span class="attr">enableViewStateMac</span><span class="kwrd">="true"</span> <span class="attr">validateRequest</span><span class="kwrd">="false"</span> <span class="attr">pageParserFilterType</span><span class="kwrd">="Microsoft.SharePoint.ApplicationRuntime.SPPageParserFilter, Microsoft.SharePoint, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c"</span> <span class="attr">asyncTimeout</span><span class="kwrd">="7"</span> <span class="attr">enableEventValidation</span><span class="kwrd">="false"</span><span class="kwrd">&gt;</span><br />

Save your web.config, and your good to go.

Tweet about this on TwitterShare on Google+Share on FacebookShare on RedditEmail this to someoneShare on LinkedInShare on StumbleUpon

Leave a Reply

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