Export (0) Print
Expand All

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)

member ControlType : Type with get

Property Value

Type: System.Type
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.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0, 2.0

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

© 2014 Microsoft