views:

22

answers:

1

How to fetch Client ID's of asp.net control in external javascript file i google it but didn't find any relevant answer if somebody can tell me or provide me some good links

A: 

You can't. The external javascript file is fetched as a separate request, so the page object with the control where the information is doesn't exist any more when the script is requested.

Guffa
are there any work around what i am doing is writing thier full client id like ct100_something
Mac
@Mac: As you are using jQuery, you can add a class name to the control and use `$('.something')` to access the element.
Guffa
ya but the problem there is there can be multiple element with same class
Mac
@Mac: You can have multiple classes on an element, so you can add a unique class to each element.
Guffa