I"m using VB.Net and I have a master page that contains an asp Menu control that contains 7 parent items. What I'm trying to do in the code-behind file is change the backcolor of each parent item except 1 (which is a "Login" menuItem). I have a For Loop that disables each menu item until the user has successfully logged in, however, I want to change the backcolor also to visually let the user know they are or are not logged in. How can I do this? My code is below.
Private Sub DisableMenu()
For Each mnu As MenuItem In Menu1.Items
If mnu.Value = "mnuLogin" Then
'Change the BackColor for each Parent Item
mnu.Enabled = False
Catch ex As Exception
lblMessage.Text = dbIO.DisplayError("DisableMenu()", "SiteMP", ex.Message)