SPWebPartManager.ConnectWebParts 方法 (WebPart, ProviderConnectionPoint, WebPart, ConsumerConnectionPoint, WebPartTransformer)

创建两个 Web 部件之间的连接。

命名空间:  Microsoft.SharePoint.WebPartPages
程序集:  Microsoft.SharePoint(位于 Microsoft.SharePoint.dll 中)

语法

声明
Public Overrides Function ConnectWebParts ( _
    provider As WebPart, _
    providerConnectionPoint As ProviderConnectionPoint, _
    consumer As WebPart, _
    consumerConnectionPoint As ConsumerConnectionPoint, _
    transformer As WebPartTransformer _
) As WebPartConnection
用法
Dim instance As SPWebPartManager
Dim provider As WebPart
Dim providerConnectionPoint As ProviderConnectionPoint
Dim consumer As WebPart
Dim consumerConnectionPoint As ConsumerConnectionPoint
Dim transformer As WebPartTransformer
Dim returnValue As WebPartConnection

returnValue = instance.ConnectWebParts(provider, _
    providerConnectionPoint, consumer, _
    consumerConnectionPoint, transformer)
public override WebPartConnection ConnectWebParts(
    WebPart provider,
    ProviderConnectionPoint providerConnectionPoint,
    WebPart consumer,
    ConsumerConnectionPoint consumerConnectionPoint,
    WebPartTransformer transformer
)

参数

返回值

类型:System.Web.UI.WebControls.WebParts.WebPartConnection
包含有关提供程序、 使用者,和转换器连接所需的信息SPWebPartConnection

异常

异常 条件
WebPartPageUserException

providerConnectionPoint或consumerConnectionPoint是Windows SharePoint Services 2.0连接接口,如果provider或consumer Web 部件不在区域中,或者ConnectWebParts(WebPart, ProviderConnectionPoint, WebPart, ConsumerConnectionPoint, WebPartTransformer)false

备注

此重写调用后条件检查以确定是否可以直接连接 Web 部件连接两个 Web 部件。

另请参阅

引用

SPWebPartManager 类

SPWebPartManager 成员

ConnectWebParts 重载

Microsoft.SharePoint.WebPartPages 命名空间