ConnectionPoint.ControlType Property

Gets the Type of the server control with which a connection point is associated.

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

public:
property Type^ ControlType {
	Type^ get ();
}
/** @property */
public Type get_ControlType ()

public function get ControlType () : Type

Not applicable.

Property Value

A Type representing the control type.

The value of the ControlType property is often the WebPart type. However, because any type of user control or server control can participate in connections if it is properly enabled and placed in a WebPartZoneBase zone, the ControlType property can return one of these other server control types as well.

When server controls that are not WebPart controls are placed in a WebPartZoneBase zone, they are wrapped with a GenericWebPart object at run time so they can function as WebPart controls and participate in connections. But when such controls are involved in connections, the ControlType property value does not return the GenericWebPart type; it returns the type of the GenericWebPart object's child control, which is the type of the server or user control.

The following code example demonstrates the use of the ControlType 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 ControlType 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: