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)
Available in Sandboxed Solutions: No
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
provider
Type: System.Web.UI.WebControls.WebParts.WebPartThe provider Web Part control.
providerConnectionPoint
Type: System.Web.UI.WebControls.WebParts.ProviderConnectionPointThe provider connection point.
consumer
Type: System.Web.UI.WebControls.WebParts.WebPartThe consumer Web Part.control.
consumerConnectionPoint
Type: System.Web.UI.WebControls.WebParts.ConsumerConnectionPointThe consumer connection point.
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. |