AJAX TOOLKIT : Accordion (can't access controls)

  • Thread starter Thread starter googlegroup
  • Start date Start date
G

googlegroup

I have master pages , with MyAccordion and 2 panes.
I can veiw the controls within MyAccordion on pageLoad


Output of controls:

MyAccordion_AccordionExtender
AccordionPane1
AccordionPane2

However, with the code below, it fails

Try
Dim frm As Control =
Page.Master.FindControl("Main").FindControl("form1").FindControl("MyAccordion")
Dim acc As Control
acc = DirectCast(frm.FindControl("AccordionPane1"),
AjaxControlToolkit.AccordionPane)

Dim str As String = ""
Dim ctl As Control
For Each ctl In acc.Controls

str = str & ctl.ID.ToString & "<br>"

Next
Return str
Catch ex As Exception
Return ex.Message
End Try


Output : Object reference not set to an instance of an object.


How do you gain access to the controls (in my case radiobuttons) that
belong within the two panes in MyAccordion on PageLoad ?
 
Back
Top