JQuery Selector for ASP.NET server side control

I can't remember how many times I googled over this small snippet. Better save it somewhere we all can access.


  • $('#<%=ServerSideControl.ClientID%>') will find an element with the id attribute as supplied by theClientID property in ASP.Net.


  • $("[id$=ServerSideControl]") will find an element with an id attribute that ends with lblName, for examplefoo-lblName.

Popular posts from this blog

Print a sales receipt using a thermal printer with C# for POS Application

Automatic redirect upon session timeout using ASP.NET MVC and Javascript

Could not create SSL/TLS secure channel - Fixed