CJ_S
asked on
AssociatedControlId
I am assuming you are familiar with the associatedcontrolid attribute of the label webcontrol.
<asp:label runat="server" text="Name *" associatedcontrolid="txtna me" />
<asp:textbox id="txtname" runat="server" />
This bit of code will set focus on the textbox when the label is clicked. The same behavior happens when the associated control is a dropdownlist or any other basic form element.
Now I have a custom control which dynamically creates a few dropdownlists (no other controls). When specifying the associatedcontrolid to my custom control (eciCulture) it will not automatically activate the first dropdownlist. How can I make sure this behavior does happen without writing the HTMLcode for the label myself?
Is there an Attribute available that can be specified in the custom control?
<asp:label runat="server" text="Name *" associatedcontrolid="txtna
<asp:textbox id="txtname" runat="server" />
This bit of code will set focus on the textbox when the label is clicked. The same behavior happens when the associated control is a dropdownlist or any other basic form element.
Now I have a custom control which dynamically creates a few dropdownlists (no other controls). When specifying the associatedcontrolid to my custom control (eciCulture) it will not automatically activate the first dropdownlist. How can I make sure this behavior does happen without writing the HTMLcode for the label myself?
Is there an Attribute available that can be specified in the custom control?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
If you happen to find out another solution (which doesn't involve just the clientid) I'd be happy to learn about it.
ASKER
Thank you for your time.