【问题标题】:Sharepoint adding customcontrol to web-part errorSharepoint 将自定义控件添加到 Web 部件错误
【发布时间】:2012-04-14 03:16:37
【问题描述】:

我是 Sharepoint 的新手。我创建了自定义控件并将其添加到 web 部件。我已经注册了控件:

<%@ Register TagPrefix="UserControls" TagName="FormContactUs"
Src="~/_CONTROLTEMPLATES/FormContactUs.ascx" %> 
<%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages"
Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<UserControls:FormContactUs runat="server" id="formContactUs" Mode="Colleague" />

但它返回错误:“元素'FormContactUs'是未知元素。如果存在编译错误或web.config文件丢失,可能会发生这种情况”

请提供任何可能出现问题的想法。谢谢!

【问题讨论】:

    标签: sharepoint user-controls web-parts


    【解决方案1】:

    你需要像这样引用用户控件:

    <UserControls:FormContactUs runat="server" ID="formContactUs" Mode="Colleague" />
    

    编码愉快!

    【讨论】:

    猜你喜欢
    • 2010-11-02
    • 2021-10-08
    • 2011-06-13
    • 2013-09-24
    • 2015-08-02
    • 2012-01-20
    • 1970-01-01
    • 2012-12-24
    • 2013-11-28
    相关资源
    最近更新 更多