Label.AssociatedControlID Property (System.Web.UI.WebControls)

Switch View :
ScriptFree
.NET Framework Class Library
Label.AssociatedControlID Property

Gets or sets the identifier for a server control that the Label control is associated with.

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

Visual Basic
<TypeConverterAttribute(GetType(AssociatedControlConverter))> _
<ThemeableAttribute(False)> _
Public Overridable Property AssociatedControlID As String
C#
[TypeConverterAttribute(typeof(AssociatedControlConverter))]
[ThemeableAttribute(false)]
public virtual string AssociatedControlID { get; set; }
Visual C++
[TypeConverterAttribute(typeof(AssociatedControlConverter))]
[ThemeableAttribute(false)]
public:
virtual property String^ AssociatedControlID {
	String^ get ();
	void set (String^ value);
}
F#
[<TypeConverterAttribute(typeof(AssociatedControlConverter))>]
[<ThemeableAttribute(false)>]
abstract AssociatedControlID : string with get, set
[<TypeConverterAttribute(typeof(AssociatedControlConverter))>]
[<ThemeableAttribute(false)>]
override AssociatedControlID : string with get, set
ASP.NET
<asp:Label AssociatedControlID="String" />

Property Value

Type: System.String
A string value corresponding to the ID for a server control contained in the Web form. The default is an empty string (""), indicating that the Label control is not associated with another server control.
Remarks

Use the AssociatedControlID property to associate a Label control with another server control on a Web form. When a Label control is associated with another server control, its attributes can be used to extend the functionality of the associated control. You can use the Label control as a caption for another control, or you can set the tab index or hot key for an associated control.

When the AssociatedControlID property is set, the Label control renders as an HTML label element, with the for attribute set to the ID property of the associated control. You can set other attributes of the label element using the Label properties. For example, you can use the Text and AccessKey properties to provide the caption and hot key for an associated control.

This property cannot be set by themes or style sheet themes. For more information, see ThemeableAttribute and ASP.NET Themes and Skins.

Version Information

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0
Platforms

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

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

Reference

Other Resources