This documentation is archived and is not being maintained.
WebPartManager::ConnectWebParts Method (WebPart, ProviderConnectionPoint, WebPart, ConsumerConnectionPoint, WebPartTransformer)
Visual Studio 2010
Creates a connection between two WebPart or GenericWebPart controls using the references to the controls, their specified ConnectionPoint objects, and a WebPartTransformer object.
Assembly: System.Web (in System.Web.dll)
public: virtual WebPartConnection^ ConnectWebParts( WebPart^ provider, ProviderConnectionPoint^ providerConnectionPoint, WebPart^ consumer, ConsumerConnectionPoint^ consumerConnectionPoint, WebPartTransformer^ transformer )
Parameters
- provider
- Type: System.Web.UI.WebControls.WebParts::WebPart
A WebPart that has the role of furnishing data to another connected control.
- providerConnectionPoint
- Type: System.Web.UI.WebControls.WebParts::ProviderConnectionPoint
A public method in provider that is marked with a ConnectionProvider metadata attribute, and serves as a callback method for the connection.
- consumer
- Type: System.Web.UI.WebControls.WebParts::WebPart
A WebPart that has the role of receiving data from provider or transformer, and then processing or displaying it.
- consumerConnectionPoint
- Type: System.Web.UI.WebControls.WebParts::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
- Type: System.Web.UI.WebControls.WebParts::WebPartTransformer
A WebPartTransformer that enables a connection between two controls by converting the data from provider to a format that consumer can process.
Return Value
Type: System.Web.UI.WebControls.WebParts::WebPartConnectionA WebPartConnection that contains the information about the provider, consumer, and transformer needed for a connection.
| Exception | Condition |
|---|---|
| InvalidOperationException | Connections have already been activated in PreRender. |
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show: