SharePoint pages do not render when using unsafe controls

Applies to: Microsoft SharePoint Server 2013 Service Pack 1Microsoft SharePoint Foundation 2013 Service Pack 1Microsoft SharePoint Foundation 2010 Service Pack 2

Symptoms


After you install one of the following updates, some SharePoint pages do not render, and generate error messages such as the following: 

Cause


An allow list of ASP.NET controls is enforced in SharePoint 2010 and SharePoint 2013 after you install updates. If web parts or controls on the SharePoint pages are not added to the allow list, the pages do not render.

Resolution


If the pages no longer render because they use a control that isn't in the SafeControls list, follow these steps:

  1. Review SharePoint Unified Logging Service (ULS) logs to find the 9s9ay tag or a message that contains "Blocking control with property" that indicates that a control is blocked.
  2. Identify the type, namespace, and assembly strong name from the error message. 
    • Example 1

    Given the following error message: 

    "The type Contoso.Customizations.WebPartControl, Contoso.WebParts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f8f11d50a3a could not be found or it is not registered as safe."

    Type = "WebPartControl"

    Namespace = "Contoso.Customizations"

    Assembly strong name = "Contoso.WebParts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f8f11d50a3a"

    • Example 2

    Given the following error message:

    "Blocking control with property traversal markup. [tagName: SharePoint:WebPartControl][propName: propName1][type: typeName1]"

    Type = "WebPartControl" (not "typeName1")

    You can find the namespaces and assembly data in Microsoft Docs by querying the type name.

  3. Add a new SafeControls element for the given type, namespace, and assembly strong name to the Web.config file under the configuration/SharePoint/SafeControls element, as described in SafeControls element (Solution), and then set the Safe attribute to TRUE.

For more information about the format of the attribute values in the SafeControls element, refer to the table in the step 12 in Marking Safe Controls in the Package Designer.

Workaround


If you have many unsafe controls, you can work around this issue by following these steps:

  1. Edit the SafeMode element in the Web.config file under the configuration/SharePoint element.
  2. Add a ControlCompatMode attribute that has a value of True