SPLimitedWebPartManager.SPConnectWebParts method (WebPart, ProviderConnectionPoint, WebPart, ConsumerConnectionPoint)

Connects two compatible Web Part connection points.

Namespace:  Microsoft.SharePoint.WebPartPages
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'Declaration
Public Function SPConnectWebParts ( _
    provider As WebPart, _
    providerConnectionPoint As ProviderConnectionPoint, _
    consumer As WebPart, _
    consumerConnectionPoint As ConsumerConnectionPoint _
) As SPWebPartConnection
'Usage
Dim instance As SPLimitedWebPartManager
Dim provider As WebPart
Dim providerConnectionPoint As ProviderConnectionPoint
Dim consumer As WebPart
Dim consumerConnectionPoint As ConsumerConnectionPoint
Dim returnValue As SPWebPartConnection

returnValue = instance.SPConnectWebParts(provider, _
    providerConnectionPoint, consumer, _
    consumerConnectionPoint)
public SPWebPartConnection SPConnectWebParts(
    WebPart provider,
    ProviderConnectionPoint providerConnectionPoint,
    WebPart consumer,
    ConsumerConnectionPoint consumerConnectionPoint
)

Parameters

Return value

Type: Microsoft.SharePoint.WebPartPages.SPWebPartConnection
The SPWebPartConnection object for the connected connection points.

Exceptions

Exception Condition
WebPartPageUserException

The provider or consumer Web Part is not on the page.

See also

Reference

SPLimitedWebPartManager class

SPLimitedWebPartManager members

SPConnectWebParts overload

Microsoft.SharePoint.WebPartPages namespace