ConnectionPoint.ID Property

Gets a string that contains the identifier for a connection point.

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

public:
property String^ ID {
	String^ get ();
}
/** @property */
public String get_ID ()

public function get ID () : String

Not applicable.

Property Value

A string that contains the identifier for a connection point.

When a developer declares a ConnectionConsumerAttribute or a ConnectionProviderAttribute attribute on a method in the source code of a control, so that the method can be used as a connection point, it is not required to declare the ID parameter for the connection point attribute. The only required attribute is the displayName parameter. A default ID is assigned to the connection point, using the value from the DefaultID field.

If there is only one method in a control being used as a connection point, it is unnecessary to specify an ID for the connection point. If there are multiple methods specified as connection points, you must specify an ID for each one; otherwise, an exception will be thrown. By assigning an ID to each connection point, you also make it possible to specify which connection point to use when you declare connections in Web pages or create them in code.

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