If it is possible to select an asp object like asp:Label by JQuery?
Thanks a lot.
There are 3 main ways of selecting an element in jQuery.
By Id
$('#<%=lbl.ClientID%>');
By css Class
$('.className');
By attribute or tag type
$('input[name=lblName]');
Refer to this link for more ways of selecting an element How do i use jQuery selectors?
Hope this help
A coworker of mine wrote a post on how to extend jQuery to do exactly what you're wanting. The result is the ability select an asp control like this:
$(":asp(txtName)")
He accomplishes this by basically adding the following function:
jQuery.expr[':'].asp = function(elem, i, match) {
return (elem.id && elem.id.match(match[3] + "$"));
}
For a full explanation, please see his post here: Extending jQuery to Select ASP Controls