Compartilhar via


SPWebPartManager.ConnectWebParts Method (WebPart, ProviderConnectionPoint, WebPart, ConsumerConnectionPoint, WebPartTransformer)

Creates a connection between two Web Parts.

Namespace:  Microsoft.SharePoint.WebPartPages
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No

Syntax

'Declaration
Public Overrides Function ConnectWebParts ( _
    provider As WebPart, _
    providerConnectionPoint As ProviderConnectionPoint, _
    consumer As WebPart, _
    consumerConnectionPoint As ConsumerConnectionPoint, _
    transformer As WebPartTransformer _
) As WebPartConnection
'Usage
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
)

Parameters

Return Value

Type: System.Web.UI.WebControls.WebParts.WebPartConnection
A SPWebPartConnection that contains the information about the provider, consumer, and transformer needed for a connection.

Exceptions

Exception Condition
WebPartPageUserException

Either the providerConnectionPoint or consumerConnectionPoint is a Windows SharePoint Services 2.0 connection interface, if either the provider or consumer Web Part is not in a zone, or if ConnectWebParts(WebPart, ProviderConnectionPoint, WebPart, ConsumerConnectionPoint, WebPartTransformer) is false

Remarks

This override is called to connect two Web Parts after a conditional check to determine whether the Web Parts can be directly connected.

See Also

Reference

SPWebPartManager Class

SPWebPartManager Members

ConnectWebParts Overload

Microsoft.SharePoint.WebPartPages Namespace