Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
3338
Web toolbar and master page problem.
posted

I have a webtoolbar on master page in a Content area.

at runtime (code behind) i turn certain buttons off.

However when the project runs I get an null reference error on a tlbr item.

 in the setMenuButtons sub, i get the error on the first line.

 

Inherits System.Web.UI.MasterPageProtected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

 

End Sub

Private Sub setMenuButtons(ByVal bvalue As Boolean)

tlbrMain.Items.FromKeyButton("RecipSrch").Visible = bvalue

tlbrMain.Items.FromKeyButton("LocatSrch").Visible = bvalue

tlbrMain.Items.FromKeyButton("pickup").Visible = bvalue

tlbrMain.Items.FromKeyButton("logout").Visible = bvalue

tlbrMain.Items.FromKeyButton("LogInPage").Visible = bvalue

tlbrMain.Items.FromKeyButton("help").Visible = bvalue

End Sub

Private Sub HeadContent_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles HeadContent.Load

If SCLSession.QuickSearch = True Then

setMenuButtons(False)

Else

setMenuButtons(True)

End If

If SCLSession.IsLoggedIn Then

tlbrMain.Items.FromKeyButton("LogInPage").Visible = False

tlbrMain.Items.FromKeyButton("logout").Visible = True

tlbrMain.Items.FromKeyButton("RecipSrch").Visible = True

tlbrMain.Items.FromKeyButton("LocatSrch").Visible = True

tlbrMain.Items.FromKeyButton("pickup").Visible = True

Else

tlbrMain.Items.FromKeyButton("LogInPage").Visible = True

tlbrMain.Items.FromKeyButton("logout").Visible = False

tlbrMain.Items.FromKeyButton("RecipSrch").Visible = False

tlbrMain.Items.FromKeyButton("LocatSrch").Visible = False

tlbrMain.Items.FromKeyButton("pickup").Visible = False

End If

End Sub

End Class