Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

Ghosted pages in SharePoint don't render


View products that this article applies to.

Symptoms

After you install one of the following updates, some ghosted pages in Microsoft SharePoint don't render:

For example, Microsoft Identity Manager (MIM) portal pages and some customized pages that are deployed through SharePoint Solution don't render.

Additionally, you may experience one or more of the following scenarios.

Scenario 1

The blocked ghosted page displays one of the following error messages: 


Scenario 2

The blocked ghosted page displays the following error message:


Scenario 3

The blocked ghosted page displays the following error message:

↑ Back to the top


Cause

Ghosted pages are stored in the file system. Their security level is enhanced by forbidding server-side scripts and unsafe controls. A ghosted page may be blocked from rendering if the following conditions are true:

  • The ghosted page contains in-line code or server-side script.
  • The code-behind type or web part type isn't registered as safe.

↑ Back to the top


Resolution for Scenario 1

To resolve this issue, add a new PageParserPath element that has a VirtualPath attribute to the Web.config file under the configuration/SharePoint/SafeMode/PageParserPaths element.

For example, you receive the following error message:

"The attribute 'autoeventwireup' is not allowed in this page."

In this case, you can add a PageParserPath element, as follows:

<SafeMode MaxControls="200" CallStack="false" DirectFileDependencies="15" TotalFileDependencies="250" AllowPageLevelTrace="false">
    <PageParserPaths>
        <PageParserPath VirtualPath="/<relativepath>/page.aspx" CompilationMode="Always" AllowServerSideScript="true" AllowUnsafeControls="true" IncludeSubFolders="True"/>
    </PageParserPaths>
</SafeMode>


If all pages in the same virtual directory have to be unblocked, you can use a PageParserPath element, as follows:

<SafeMode MaxControls="200" CallStack="false" DirectFileDependencies="15" TotalFileDependencies="250" AllowPageLevelTrace="false">
    <PageParserPaths>
        <PageParserPath VirtualPath="/<relativepath>/*" CompilationMode="Always" AllowServerSideScript="true" AllowUnsafeControls="true" IncludeSubFolders="True"/>
    </PageParserPaths>
</SafeMode>
 

↑ Back to the top


Resolution for Scenario 2

To resolve this issue, 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). 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 step 12 in the "Marking Safe Controls in the Package Designer" section of How to: Mark controls as safe controls.

↑ Back to the top


Resolution for Scenario 3

To resolve this issue, add a new SafeControls element that uses the Src attribute to the Web.config file under the configuration/SharePoint/SafeControls element.

For example, you receive the following error message:

"The referenced file '/_layouts/somedirectory/affectedusercontrol.ascx' is not allowed on this page."

In this case, you can add the SafeControls element, as in the following examples:

< SafeControls>
    <SafeControl Src="~/_layouts/somedirectory/*" IncludeSubFolders="True" Safe="True" AllowRemoteDesigner="True" SafeAgainstScript="True" />
</SafeControls>
 
< SafeControls>
    <SafeControl Src="~/_layouts/somedirectory/*" IncludeSubFolders="True" Safe="True" />
</SafeControls>

↑ Back to the top


Keywords: sharepoint ghosted pages not render

↑ Back to the top

Article Info
Article ID : 4584132
Revision : 18
Created on : 10/1/2020
Published on : 10/2/2020
Exists online : False
Views : 343