I have one control with some asp form elements, but how do I get the form elements in my other control. I usually do jQuery(‘#<%= MyDropDownList.ClientID %>).val(), but this is not possible since it is in the other control. How do I access the element without hardcoding it?
So to sum it up:
Control 1: Asp:DropDownList
Control 2: Needs access to the value in the asp:DropDownlist from control 1 through jQuery.
If the names are unique, you can use the selector does name matching on the end of the id.
This will match all controls whose id ends with
DropDownList1and get the value of the first one. If the name is unique, then it will be your other dropdown list.