ConnectionPoint::AllowsMultipleConnections Property
Gets a value that indicates whether a connection point supports multiple simultaneous connections.
Assembly: System.Web (in System.Web.dll)
Property Value
Type: System::Booleantrue 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.
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.