This topic has not yet been rated - Rate this topic

WebPartManager.CanConnectWebParts Method (WebPart, ProviderConnectionPoint, WebPart, ConsumerConnectionPoint, WebPartTransformer)

Checks the WebPart controls that will be participating in a connection to determine whether they are capable of being connected, and uses a WebPartTransformer object to create the connection between an incompatible consumer and provider.

Namespace:  System.Web.UI.WebControls.WebParts
Assembly:  System.Web (in System.Web.dll)
public virtual bool CanConnectWebParts(
	WebPart provider,
	ProviderConnectionPoint providerConnectionPoint,
	WebPart consumer,
	ConsumerConnectionPoint consumerConnectionPoint,
	WebPartTransformer transformer
)

Parameters

provider
Type: System.Web.UI.WebControls.WebParts.WebPart

The control that provides data to consumer when the controls are connected.

providerConnectionPoint
Type: System.Web.UI.WebControls.WebParts.ProviderConnectionPoint

A ConnectionPoint that acts as a callback method so that provider can participate in a connection.

consumer
Type: System.Web.UI.WebControls.WebParts.WebPart

The control that receives data from provider when the controls are connected.

consumerConnectionPoint
Type: System.Web.UI.WebControls.WebParts.ConsumerConnectionPoint

A ConnectionPoint that acts as a callback method so that consumer can participate in a connection.

transformer
Type: System.Web.UI.WebControls.WebParts.WebPartTransformer

A WebPartTransformer that enables an incompatible provider and consumer to connect.

Return Value

Type: System.Boolean
A Boolean value that indicates whether provider and consumer can form a connection.

This method is used to connect provider and consumer when both controls have incompatible connection point types, so that a WebPartTransformer object is required. You might want to use this method to verify that two controls can be connected before calling ConnectWebParts to create a programmatic connection.

This overload uses the same implementation as the CanConnectWebParts(WebPart, ProviderConnectionPoint, WebPart, ConsumerConnectionPoint) method overload, with the only exception being that this overload requires a transformer.

.NET Framework

Supported in: 4.5, 4, 3.5, 3.0, 2.0

Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.