我正在 SharePoint 2010 中构建 Web 部件,并且需要使用 TaxonomyFieldControl 进行筛选。我已在项目中设置了引用(不是“intl”的引用,v14.0.0.0),但收到警告:“元素“TaxonomyFieldControl”不是已知元素。如果存在编译错误,则可能会发生这种情况网站中,或者 web.config 文件丢失。”在编译时,在运行时我得到“未知服务器标记'Taxonomy:TaxonomyFieldControl'”
<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="Taxonomy" Namespace="Microsoft.SharePoint.Taxonomy" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="WebPart_DocumentsUserControl.ascx.cs" Inherits="Test.WebPart_Documents.WebPart_DocumentsUserControl" %>
...
<Taxonomy:TaxonomyFieldControl FieldName="TaxonomyFilter" runat="server"></Taxonomy:TaxonomyFieldControl>
还值得注意的是,“Taxonomy”不会与 Intellisense 一起出现,“Utilities”也不会出现,但其余的都会出现。同样在后面的代码中,我有:
using Microsoft.SharePoint.Taxonomy;
编译得很好。
我已尝试按照 http://blog.tentaclesoftware.com/archive/2010/07/21/95.aspx 删除我的架构缓存
谢谢!
最佳答案
您注册了错误的程序集。而不是:
<%@ Register TagPrefix="Taxonomy" Namespace="Microsoft.SharePoint.Taxonomy"
Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral,
PublicKeyToken=71e9bce111e9429c" %>
尝试:
<%@ Register TagPrefix="Taxonomy" Namespace="Microsoft.SharePoint.Taxonomy"
Assembly="Microsoft.SharePoint.Taxonomy, Version=14.0.0.0, Culture=neutral,
PublicKeyToken=71e9bce111e9429c" %>
关于c# - 未知服务器标签 'Taxonomy:TaxonomyFieldControl',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7683842/