AJAX TOOLKIT : Accordion (can't access controls)

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 ?
 
M

MasterGaurav \(www.edujini-labs.com\)

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top