I have a tabcontainer control which contains 5 tabs. Each tab contains a usercontrol if i create a button e.g btnControl1 in usercontrol of tab1 & in second tab’s usercontrol i create a button with the same name btnControl1. How can i filter tab1’s usercontrol’s btnControl1 & tab2’s usercontrol’s btnControl1 using Jquery
I have a tabcontainer control which contains 5 tabs. Each tab contains a usercontrol
Share
You could filter using the tab name and the control, e.g.
However, it’s still best practice to try and avoid having the same ID’s on the same page.
ASP.NET often changes the ID from what you set it server side, so you can use the ClientID property (if using ASP.NET 4) to give a unique ID to each button.
Good article about ClientID – https://web.archive.org/web/20211020203215/https://www.4guysfromrolla.com/articles/031710-1.aspx