Label.AssociatedControlID 屬性

定義

取得或設定與 Label 控制項關聯之伺服器控制項的識別項。

public:
 virtual property System::String ^ AssociatedControlID { System::String ^ get(); void set(System::String ^ value); };
public virtual string AssociatedControlID { get; set; }
[System.ComponentModel.TypeConverter(typeof(System.Web.UI.WebControls.AssociatedControlConverter))]
[System.Web.UI.Themeable(false)]
public virtual string AssociatedControlID { get; set; }
member this.AssociatedControlID : string with get, set
[<System.ComponentModel.TypeConverter(typeof(System.Web.UI.WebControls.AssociatedControlConverter))>]
[<System.Web.UI.Themeable(false)>]
member this.AssociatedControlID : string with get, set
Public Overridable Property AssociatedControlID As String

屬性值

字串值,對應於 Web Form 中所包含之伺服器控制項的 ID。 預設值是空字串 (""),表示 Label 控制項與其他伺服器控制項沒有關聯。

屬性

備註

AssociatedControlID使用 屬性,將控制項與 Web 表單上的另一個伺服器控制項產生關聯 LabelLabel當控制項與另一個伺服器控制項相關聯時,其屬性可用來擴充相關聯控制項的功能。 您可以使用 Label 控制項做為另一個控制項的標題,也可以設定關聯控制項的索引鍵或熱鍵。

AssociatedControlID設定屬性時, Label 控制項會轉譯為 HTML label 專案,並將 for 屬性設定為 ID 相關聯控制項的 屬性。 您可以使用 屬性來設定專案 Label 的其他屬性 label 。 例如,您可以使用 TextAccessKey 屬性來提供相關聯控制項的標題和熱鍵。

這個屬性無法由佈景主題或樣式表主題設定。 如需詳細資訊,請參閱 ThemeableAttributeASP.NET 主題和麵板

適用於

另請參閱