Link to home
Start Free TrialLog in
Avatar of CJ_S
CJ_SFlag for Netherlands

asked on

AssociatedControlId

I am assuming you are familiar with the associatedcontrolid attribute of the label webcontrol.

<asp:label runat="server" text="Name *" associatedcontrolid="txtname" />
<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
Avatar of Sammy
Sammy
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of CJ_S

ASKER

It's not the answer I was looking for, but it does seem correct...

Thank you for your time.
Avatar of CJ_S

ASKER

If you happen to find out another solution (which doesn't involve just the clientid) I'd be happy to learn about it.