简体   繁体   English

自定义SharePoint母版页

[英]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." 我通过添加asp:XmlDataSource定制了SharePoint母版页导航菜单,但我得到“此页面上不允许使用控件类型'System.Web.UI.WebControls.XmlDataSource'。该类型未注册为安全。” Error. 错误。
I really appreciate any help. 我非常感谢任何帮助。

You have to add the assembly as a safe control assembly in your web.config file. 您必须在web.config文件中将程序集添加为安全控件程序集。

<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". 在您的Package.Template.xml中添加安全控制条目。此文件可以找到文件路径“\\ 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> 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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