I need to expand a rad panel bar that is in a master page based on what page is loaded. I have this in my page load method but I get a null reference error. I'm guessing it's because the panelbar is in the master page. How do I access my panelbar in child page and expand one of the items of my choice. Here is the code I am trying
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim panel As RadPanelBar = Master.FindControl("RadPanelBar1")
Dim item As RadPanelItem = panel.Items.FindItemByText("Entities")
item.Expanded = True
End Sub
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim panel As RadPanelBar = Master.FindControl("RadPanelBar1")
Dim item As RadPanelItem = panel.Items.FindItemByText("Entities")
item.Expanded = True
End Sub