0

我创建了一个可视化 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?

4

2 回答 2

1

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

看:

如何:声明两个 Web 部件控件之间的静态连接

于 2012-02-27T06:51:46.913 回答
0

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

于 2012-03-06T05:47:43.637 回答