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:
- Decrease the number of controls per page to be less than 200 controls.
- 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.
- Open your SharePoint page that encountered this error "
This page allows a limit of 200 controls, and that limit has been exceeded.
" .
- At the end of your URL, add ?contents=1 to open the maintenance page
- 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.
- Browse your page now, that should be working as expected.
- 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:
- Open IIS, Right Click on your SharePoint Web Application> Click Explore.
- Take a backup from your SharePoint Config file "
web.config
".
- Open the "
web.config
" using any editor, and search for MaxControls= below <SharePoint>
tag.
Change the MaxControls="200"
to MaxControls="250"
then save your file.
<SharePoint>
<SafeMode MaxControls="250" CallStack="true" DirectFileDependencies="10" TotalFileDependencies="250" AllowPageLevelTrace="false">
- Repeat the above steps for the same web applications on your WFE SharePoint Server cross the farm.
- 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