ConsumerConnectionPoint.SupportsConnection Method (Control, ConnectionInterfaceCollection)


Determines whether a consumer connection point is currently capable of establishing a connection.

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

public virtual bool SupportsConnection(
	Control control,
	ConnectionInterfaceCollection secondaryInterfaces


Type: System.Web.UI.Control

The consumer control associated with the ConsumerConnectionPoint.

Type: System.Web.UI.WebControls.WebParts.ConnectionInterfaceCollection

A ConnectionInterfaceCollection of any secondary interfaces that participate in a connection.

Return Value

Type: System.Boolean

true if a connection point can currently establish a connection; otherwise, false. The default is true.

The SupportsConnection method as implemented always returns true in all cases for the ConsumerConnectionPoint class. The intent for this method is to have it check on the state of control and secondaryInterfaces at certain critical points to determine whether a ConsumerConnectionPoint object is presently able to create a connection.

There can be scenarios where control is in a state that would make it impossible to form a connection, or where secondaryInterfaces must exist before a connection can be formed. In such cases, developers can inherit from the ConsumerConnectionPoint class, and override the SupportsConnection method, providing a custom implementation to determine when the connection point is ready to support connections.

.NET Framework
Available since 2.0
Return to top