I have an ASP.NET Usercontrol and am using JQuery to do some stuff for me. I use the User control dynamically in different pages. I need to get the ControlID of the control that is in the user control. How do i dynamically do a $('#myControl') instead if $('#HostPage.myControl'), what is the syntax for $('<%#myControl.ControlID'%>), or can I do this.
+2
A:
Should be
$('#<% = myControl.ClientID %>')
$("[id$='myControl']")
might also work - that'd find you an element with an ID that ends with myControl.
Kobi
2009-06-15 16:56:22
$('#<% = myControl.ClientID %>') is not working. ANy reasons?
Greens
2009-06-15 17:06:43
Thanks for the answer
Greens
2009-06-15 17:07:16