Ask questions and get good answers on jQuery

I've seen a few options for selecting ASP.NET controls that have generated IDs. What is the best (most concise, efficient and flexible) method of selecting controls that are in user controls that might then appear multiple times on a page?

asked Jan 25 '10 at 16:34

Bernhard%20Hofmann's gravatar image

Bernhard Hofmann
926


the most straightforward

<script type="text/javascript">

var _TheControl = '#<%= txtTheControl.ClientID %>';

$(_TheControl ).val(); // or whatever jquery function at that point.

</script>

answered Jan 25 '10 at 17:32

Jason%20w's gravatar image

Jason w
161

$('[id$=ControlID]')

is a pretty simple way to select controls with jquery

answered Jan 25 '10 at 18:32

jmein's gravatar image

jmein
736

edited Jan 25 '10 at 19:16

Your answer
toggle preview

jQuery main site - Matteo Bicocchi