[英]Customizing SharePoint master page
我通过添加asp:XmlDataSource定制了SharePoint母版页导航菜单,但我得到“此页面上不允许使用控件类型'System.Web.UI.WebControls.XmlDataSource'。该类型未注册为安全。” 错误。
我非常感谢任何帮助。
您必须在web.config文件中将程序集添加为安全控件程序集。
<configuration>
<SharePoint>
<SafeControls>
<SafeControl Assembly="[Assembly Name]" Namespace="[Namespace]" TypeName="*" Safe="True" />
</SafeControls>
</SharePoint>
</configuration>
在你的情况下,它将是:
<SafeControl Assembly="System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" Namespace="System.Web.UI.WebControls" TypeName="XmlDataSource" Safe="False" AllowRemoteDesigner="False" />
在您的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.