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

Gets or sets the identifier for a server control that the System.Web.UI.WebControls.Label control is associated with.

Syntax

[System.ComponentModel.DefaultValue("")]
[System.Web.UI.Themeable(false)]
[System.ComponentModel.TypeConverter(typeof(System.Web.UI.WebControls.AssociatedControlConverter))]
[System.Web.UI.IDReferenceProperty(typeof(System.Web.UI.Control))]
public virtual string AssociatedControlID { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

Use the Label.AssociatedControlID property to associate a System.Web.UI.WebControls.Label control with another server control on a Web form. When a System.Web.UI.WebControls.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 System.Web.UI.WebControls.Label control as a caption for another control, or you can set the tab index or hot key for an associated control.

When the Label.AssociatedControlID property is set, the System.Web.UI.WebControls.Label control renders as an HTML label element, with the for attribute set to the System.Web.UI.Control.ID property of the associated control. You can set other attributes of the label element using the System.Web.UI.WebControls.Label properties. For example, you can use the Label.Text and WebControl.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 System.Web.UI.ThemeableAttribute and ASP.NET Themes Overview.

Requirements

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0