简体   繁体   中英

Customizing SharePoint master page

I have customized SharePoint master page Navigation menu by adding asp:XmlDataSource but I am getting "The control type 'System.Web.UI.WebControls.XmlDataSource' is not allowed on this page. The type is not registered as safe." Error.
I really appreciate any help.

You have to add the assembly as a safe control assembly in your web.config file.

<configuration>
  <SharePoint>
    <SafeControls>
      <SafeControl Assembly="[Assembly Name]" Namespace="[Namespace]" TypeName="*" Safe="True" />
    </SafeControls>
  </SharePoint>
</configuration>

In your case it will be:

<SafeControl Assembly="System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" Namespace="System.Web.UI.WebControls" TypeName="XmlDataSource" Safe="False" AllowRemoteDesigner="False" />

Add safe control entry in Your Package.Template.xml .This file you can findfile Path "\\Package".

 <Assemblies> <Assembly DeploymentTarget="GlobalAssemblyCache" Location="YourDLLName.dll"> <SafeControls> <SafeControl Assembly="YourDLLName,Version=1.0.0.0,Culture=neutral,PublicKeyToken=1b173e0e445783a8" Namespace = "YourNameSpaceName" Safe="True" TypeName = "*"/> </SafeControls> </Assembly> </Assemblies> 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM