ConnectionPoint.AllowsMultipleConnections Property

Gets a value that indicates whether a connection point supports multiple simultaneous connections.

Namespace: System.Web.UI.WebControls.WebParts
Assembly: System.Web (in system.web.dll)

public:
property bool AllowsMultipleConnections {
	bool get ();
}
/** @property */
public boolean get_AllowsMultipleConnections ()

public function get AllowsMultipleConnections () : boolean

Not applicable.

Property Value

true if the connection point supports multiple connections; otherwise, false.

ProviderConnectionPoint objects have their AllowsMultipleConnections property value set to true (by the ConnectionProviderAttribute class), because the Web Parts control set by default enables provider connection points to form connections to multiple consumers.

In contrast, ConsumerConnectionPoint objects have their AllowsMultipleConnections property value set to false (by the ConnectionConsumerAttribute class) because the Web Parts control set by default allows consumer connection points to establish a connection to only one provider at a time.

You can change the default behavior concerning multiple connections by assigning different values to the ConnectionProviderAttribute.AllowsMultipleConnections property (for providers) or the ConnectionConsumerAttribute.AllowsMultipleConnections property (for consumers) on the two Attribute classes used for connection attributes. If you enable consumer connection points to connect to multiple providers at the same time, your code must deal with any resulting synchronization issues.

The following code example demonstrates the use of the AllowsMultipleConnections property on both ProviderConnectionPoint and ConsumerConnectionPoint objects. This code example shows only the Web page that contains the code to access the property; for the full code required to run the example, see the Example section of the ConnectionPoint class overview.

The code in the Button2_Click method of the Web page accesses the AllowsMultipleConnections property on each of the connection point objects and writes each value to a label. Execute the code by clicking the Connection Point Details button after the page is loaded in a browser.

No code example is currently available or this language may not be supported.

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.

.NET Framework

Supported in: 3.0, 2.0

Community Additions

ADD
Show: