What is an Associated ControlID?

Platform: ASP.NET| Category: Custom Controls

This is the property defined for a Label control in 2.0, which provides linking to an interactive control such as textbox,button,listbox and other asp.net controls. It defines a hot key which moves the input focus to the control defined in the property.


<asp:Label ID='Label1' runat='server' AssociatedControlID='TextBox1' Text='Enter Ur Details' 
 	Width='86px'></asp:Label>
<asp:TextBox ID='TextBox1' runat='server'></asp:TextBox>

In the above code, TextBox1 gets focused on clicking the Label1, sinced its AssociatedControlID is set to TextBox1.

Share with

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.