Saturday, May 11, 2013

Fix the Max Controls Issue in SharePoint

While working with SharePoint MasterPages, sometimes, you might see this peculiar issue, "This page allows a limit of 200 controls, and that limit has been exceeded" and ponder over what could have caused it.

The real source for this exception to be thrown is in the web.config file,

MaxControls
="200" CallStack="true" DirectFileDependencies="10" TotalFileDependencies="50" AllowPageLevelTrace="false" />

So, this is about the limit that Microsoft has typically placed in a SharePoint Web Application's web.config, the SafeMode section has a MaxControls attribute that's set to 200 by default.

Going past this threshold limit may cause stability issues for the page. This could have been caused accidentally while you were adding some custom controls on the Masterpage.

To fix this, do not try to edit the web.config Max Controls setting to a higher number as that is not recommended although for smaller enterprises it might be permissible. However, at large corporations, this would not be allowed by their IT department.

Rather, you should take out a few controls from the MasterPage by editing it in the SharePoint Designer (SPD) and do an IISReset, your page starts working again. This should save your day again.. :)

No comments:

LinkWithin

Related Posts with Thumbnails