Welcome to deBUG.to Community where you can ask questions and receive answers from Microsoft MVPs and other experts in our community.
0 like 0 dislike
2.9k views
in SharePoint Server by 22 23 29

Suddenly, I got this error "This page allows a limit of 200 controls, and that limit has been exceeded." wehn opening the SharePoint site collection, what' this limit and how to increase it?

Server Error in '/' Application.
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: This page allows a limit of 200 controls, and that limit has been exceeded.

Source Error:


Line 792:	</div>
Line 793:	<SharePoint:AjaxDelta id="DeltaPlaceHolderUtilityContent" runat="server">
Line 794:		<asp:ContentPlaceHolder id="PlaceHolderUtilityContent" runat="server"/>
Line 795:	</SharePoint:AjaxDelta>
Line 796:	<SharePoint:ScriptBlock runat="server">var g_Workspace = "s4-workspace"; </SharePoint:ScriptBlock>

Parser Error Message: This page allows a limit of 200 controls, and that limit has been exceeded.


1 Answer

1 like 0 dislike
by 163 204 403
selected by
 
Best answer

Solving: This page allows a limit of 200 controls, and that limit has been exceeded

Cause

In SharePoint, you may get this error "This page allows a limit of 200 controls, and that limit has been exceeded." in case, the number of your controls on your page exceeds the default allowed Max controls which is 200 controls per page!

<SafeMode MaxControls="200" CallStack="true" DirectFileDependencies="10" TotalFileDependencies="250" 
AllowPageLevelTrace="false">

Solution

To solve this issue, you have to do the following:

  1. Decrease the number of controls per page to be less than 200 controls.
  2. Increase the Max number of controls per page in your SharePoint Web Application configuration file "web.config"

1) Decrease the number of controls per page to be less than 200 controls.

  1. Open your SharePoint page that encountered this error "This page allows a limit of 200 controls, and that limit has been exceeded." .
  2. At the end of your URL, add ?contents=1 to open the maintenance page
  3. Select any web part that you don't need, then click on close to remove it from your page but you can still restore it back.
    SharePoint Maininace Web Part  Page
  4. Browse your page now, that should be working as expected.
  5. If the issue still exists, repeat the above steps until meeting the allowed number of max controls per page.

2) Increase the Max number of controls per page in your SharePoint Web Application configuration file

In some cases, the above solution doesn't make sense, and you need to use more than 200 controls per page!
In this case, you have to increase the value of the max controls per page in your SharePoint Web.Config by doing the following:

  1. Open IIS, Right Click on your SharePoint Web Application> Click Explore.
    Open SharePoint Web.config
  2. Take a backup from your SharePoint Config file "web.config".
  3. Open the "web.config" using any editor, and search for MaxControls= below <SharePoint> tag.
    SharePoint 2019 This page allows a limit of 200 controls, and that limit has been exceeded.
  4. Change the MaxControls="200" to MaxControls="250" then save your file.

     <SharePoint>
       <SafeMode MaxControls="250" CallStack="true" DirectFileDependencies="10" TotalFileDependencies="250" AllowPageLevelTrace="false">
    
  5. Repeat the above steps for the same web applications on your WFE SharePoint Server cross the farm.
  6. Try now to open your page that should be working properly without facing this error "This page allows a limit of 200 controls, and that limit has been exceeded."

See Also SharePoint 2019 Limitations

by 22 23 29
0 0
Very helpful as usual, many thanks
If you don’t ask, the answer is always NO!
...