aYus
aYus

Reputation: 201

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.

Upvotes: 1

Views: 4494

Answers (2)

user2150959
user2150959

Reputation: 1

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>

Upvotes: 0

Magnus Johansson
Magnus Johansson

Reputation: 28325

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" />

Upvotes: 4

Related Questions