WebPartManager.ConnectWebParts Method (WebPart, ProviderConnectionPoint, WebPart, ConsumerConnectionPoint, WebPartTransformer)
Assembly: System.Web (in system.web.dll)
public: virtual WebPartConnection^ ConnectWebParts ( WebPart^ provider, ProviderConnectionPoint^ providerConnectionPoint, WebPart^ consumer, ConsumerConnectionPoint^ consumerConnectionPoint, WebPartTransformer^ transformer )
public WebPartConnection ConnectWebParts ( WebPart provider, ProviderConnectionPoint providerConnectionPoint, WebPart consumer, ConsumerConnectionPoint consumerConnectionPoint, WebPartTransformer transformer )
public function ConnectWebParts ( provider : WebPart, providerConnectionPoint : ProviderConnectionPoint, consumer : WebPart, consumerConnectionPoint : ConsumerConnectionPoint, transformer : WebPartTransformer ) : WebPartConnection
Not applicable.
Parameters
- provider
A WebPart that has the role of furnishing data to another connected control.
- providerConnectionPoint
A public method in provider that is marked with a ConnectionProvider metadata attribute, and serves as a callback method for the connection.
- consumer
A WebPart that has the role of receiving data from provider or transformer, and then processing or displaying it.
- consumerConnectionPoint
A public method in consumer that is marked with a ConnectionConsumer metadata attribute, and connects with providerConnectionPoint to receive the data for the connection.
- transformer
A WebPartTransformer that enables a connection between two controls by converting the data from provider to a format that consumer can process.
Return Value
A WebPartConnection that contains the information about the provider, consumer, and transformer needed for a connection.| Exception type | Condition |
|---|---|
| Connections have already been activated in PreRender. |
The ConnectWebParts(WebPart,ProviderConnectionPoint,WebPart,ConsumerConnectionPoint,WebPartTransformer) overload is used to connect controls when their connection points are incompatible. The incompatibility occurs when consumer implements a different interface than provider as its connection point. The transformer converts the data into a type that can be understood by consumer.
Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.