1

How can I find a panel defined in usercontrol from its parent page using jquery?

like the equivalent of document.getElementById('<%= UserControl.FindControl("pnlInputs").ClientID %>') in jquery

Dennis
  • 32,200
  • 11
  • 64
  • 79
user648610
  • 121
  • 1
  • 5
  • 8
  • What you mean when you say parent page ? Is it a popup which you are referring as child page ? Or Masterpahe in ASP.NET which you are referring as parent page . – Pit Digger Aug 19 '11 at 13:34
  • @Sonesh parent page means aspx page using the the usercontrol containing the panel – user648610 Aug 19 '11 at 13:42

3 Answers3

2

You are probably best off giving the control a unique CssClass attribute and selecting it with $(".myParentPageControl") instead of trying to retrieve the ClientID.

Dennis
  • 32,200
  • 11
  • 64
  • 79
1

Because .NET wants to control all of the IDs, you're better off assigning class names and using them instead.

Diodeus - James MacFarlane
  • 112,730
  • 33
  • 157
  • 176
0

As you are asking equivalent to JQuery . It will be $('#<%= UserControl.FindControl("pnlInputs").ClientID %>')

Additionally check this link http://blog.qumsieh.ca/2009/03/26/jquery-accessing-the-client-generated-id-of-aspnet-controls/

Pit Digger
  • 9,618
  • 23
  • 78
  • 122