Grabbing mashed .net Control ID’s using jQuery


I need to grab a bunch of controls from repeater items in .net – They are all prefixed with something like ctl00_Content_ctl00_rptLines_… and then the actual ID I set for the control- with dot net v4 you can set your own client Id’s so this isn’t a problem, but i’m using an older version. It’s easy enough to do partial matches with jQuery;

$("span[id$='_txtName']") // match the section at the end

// you can also match text at the start, or in anywhere in the string using the following
$("span[id^=text]")
$("span[id*=text]")
  1. No comments yet.
(will not be published)