This is a migrated thread and some comments may be shown as answers.

javascript findControl

2 Answers 345 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
luc bonenfant
Top achievements
Rank 1
luc bonenfant asked on 23 Mar 2009, 03:35 PM
Hello,
I have got a DataList which contains many RadPanelbar. Each panelbar contains only one RadPanelbarItem with a template.
My template is just a label named Lb1.
I'm using the panelbar function OnClientItemClicked, but the method args.get_item().findControl("Lb1") return null.
I can't get the control by server side method with 

var lb_ID = <%= RadPanelBar1.Items(0).FindControl("Lb1").ClientID %>

 because I don't known the panelbar used.

Thanks for help.

2 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 23 Mar 2009, 03:40 PM
Hello luc bonenfant,

The findControl client-side method looks for ASP.NET Ajax based controls which have a client-side object. To find a regular HTML element you cane use this code:

var label = $telerik.findElement(args.get_item().get_element(), "Lb1");

Regards,
Albert
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
0
luc bonenfant
Top achievements
Rank 1
answered on 23 Mar 2009, 05:16 PM
Thank you, it's working.
I'm happy to know this method to get HTML element, it will often helps me.
Tags
PanelBar
Asked by
luc bonenfant
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
luc bonenfant
Top achievements
Rank 1
Share this question
or