【问题标题】:Apply Web Part Connections to web parts on the ascx page of other web parts将 Web 部件连接应用于其他 Web 部件的 ascx 页面上的 Web 部件
【发布时间】:2012-03-16 13:37:07
【问题描述】:

我创建了一个可视化 Web 部件,它将两个以前创建的 Web 部件组合成一个样式精美的 Web 部件。只需将注册标签添加到 Web 部件的 ascx 页面,然后像在页面布局上一样添加 Web 部件标签,如下所示:

WebPart_ParentAssignmentsUserControl.ascx:

<%@ Register tagprefix="WebParts" namespace="Microsoft.SharePointLearningKit.WebParts" assembly="Microsoft.SharePointLearningKit, Version=1.3.1.0, Culture=neutral, PublicKeyToken=24e5ae139825747e" %>
<%@ Register tagprefix="MyChildrenWebPart" namespace="MLG2010.WebParts.MyChildren.MyChildrenWebPart" assembly="MLG2010.WebParts.MyChildren, Version=1.0.0.0, Culture=neutral, PublicKeyToken=9f4da00116c38ec5" %>

<WebParts:AssignmentListWebPart runat="server" ListScope="false" AllowEdit="True" AllowConnect="True" Title="Assignment List Web Part" IsIncluded="True" Dir="Default" SummaryWidth="150px" IsVisible="True" AllowMinimize="True" AllowHide="True" ExportControlledProperties="True" ZoneID="" ID="g_1c528b46_baf2_4cf2_a004_91f84c4f4556" FrameState="Normal" DisplaySummary="True" ExportMode="All" SuppressWebPartChrome="False" DetailLink="" HelpLink="" MissingAssembly="Cannot import this Web Part." PartImageSmall="" AllowRemove="True" ToolTip="Assignment List - Use this web part to keep track of your SharePoint Learning Kit assignments." HelpMode="Modeless" FrameType="Default" AllowZoneChange="True" PartOrder="0" Description="Display the assignments for an instructor or learner." PartImageLarge="" IsIncludedFilter="" __MarkupType="vsattributemarkup" __WebPartId="{1c528b46-baf2-4cf2-a004-91f84c4f4556}" WebPart="true" Height="" Width=""></WebParts:AssignmentListWebPart>
<MyChildrenWebPart:MyChildrenWebPart runat="server" PageSize="5" StudentsSiteURL="/student" PictureLibraryTitle="Students Picture Library" ADChildAttribute="otheripphone" Description="My WebPart" DefaultPictureURL="../../Students Picture Library/DefaultChild.jpg" ShowErrors="True" PictureLibraryUrl="../../Students Picture Library" Title="MyChildrenWebPart" ADEntryPoint="LDAP://dc=redconnect-test" __MarkupType="vsattributemarkup" __WebPartId="{d13a3729-e2b8-4436-ac1b-b75c914a3596}" WebPart="true" __designer:IsClosed="false" id="g_d13a3729_e2b8_4436_ac1b_b75c914a3596"></MyChildrenWebPart:MyChildrenWebPart>

这里的问题是,我需要这两个 Web 部件通过 Web 部件连接进行通信。由于它们仅在 aspx 上添加到此处,sharepoint 并不“了解”它们,因此它们没有 chrome,因此我无法在浏览器中设置 Web 部件连接。

有没有办法在以这种方式添加的 Web 部件上设置 Web 部件连接?或者如果我可以激活这些 Web 部件上的 chrome?

【问题讨论】:

    标签: sharepoint web-parts webpart-connection


    【解决方案1】:

    您可以静态定义连接。请注意,使用这种方式,您无法使用浏览器创建/修改/删除连接。

    见:

    How to: Declare a Static Connection between Two Web Parts Controls

    【讨论】:

    • 我试过了,但无法让它工作。它抱怨无法找到 Web 部件。
    • 如问题中所述,是否可以在其他 Web 部件内的 Web 部件上执行此操作?
    【解决方案2】:

    最后,我把web部件分成了可以正常连接的部分,然后用样式让它看起来好像是一体的。我没有找到任何关于将 Web 部件放入其他 Web 部件的后果的文档。

    【讨论】:

      猜你喜欢
      • 2011-03-31
      • 1970-01-01
      • 2011-02-23
      • 2010-11-23
      • 2011-08-05
      • 2011-02-01
      • 2011-08-22
      • 2011-03-12
      • 2014-06-17
      相关资源
      最近更新 更多