How to change the font color of a visited item of a ASP menu

Rositta
Rositta used Ask the Experts™
on
I have a main menu. Some of the items will have a submenu. When I choose a item which has a submenu I want to have the font color of the item which has been chosen in a different color.  I want to set the same behavior when using a.visited

I would like to do this to see clearly which item of menu has been chosen. I have used "DynamicSelectedStyle" for that but when I use it, the font color of the chosen item doesn´t change.  I also used StaticSelectedStyle-ForeColor property but it didn't work either.
 Am I using the correct instruction for this?
<asp:SiteMapDataSource ID="MyMenu" runat="server" 
     ShowStartingNode="True"         StartFromCurrentNode="False"                     StartingNodeUrl="~/MyPage.aspx" />                                  
   <asp:Menu ID="Menu1" runat="server"
             DataSourceID="MyMenuDS" 
             DynamicMenuStyle-CssClass="adjustedZIndex" 
             StaticEnableDefaultPopOutImage="False" 
             DynamicVerticalOffset="36" 
             DynamicHorizontalOffset="-104" 
             SkipLinkText=""  
StaticSelectedStyle-ForeColor="Red">                          
                                       
<StaticMenuItemStyle  CssClass="MenuLevel0" />                                
     <StaticHoverStyle CssClass="MenuLevel0Hover" /> 
     <StaticSelectedStyle CssClass="MenuLevel0Visited" />
     <DynamicMenuStyle CssClass="adjustedZIndex" /> 
     <DynamicMenuItemStyle CssClass="MenuLevel1" /> 
     <DynamicHoverStyle CssClass="MenuLevel1Hover" /> 
                        
 </asp:Menu>

And here are the styles
.MenuLevel0
{	
	color:Black; font-size:small; 
}

.MenuLevel0Visited
{
	color: White; 
}

.MenuLevel1
{
	color: Black; font-size:small;	
}

.MenuLevel0Hover
{	
    font-weight:bold;
}

.MenuLevel1Hover
{		
	font-weight:bold;
}

Open in new window

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:

 I just found out how to do this. I updated the style .MenuLevel0 as show below.

.MenuLevel0
      a:link {text-decoration: none;}
      a:visited {text-decoration: none; color:Purple;}
      a:active {text-decoration: none; }
      a:hover {text-decoration: underline; background-color: #DFDFDF;}

It worked for me.

Still do not understand why setting up the property did not work

StaticSelectedStyle-ForeColor="Red"

DynamicSelectedStyle-ForeColor="Red"





Top Expert 2007

Commented:
It might be a syntax issue. Try this:

StaticSelectedStyle.ForeColor="Red"
The order is very important.

Link
Visited
Hover
Active

This is something I use to remember the order:
LoVe HAte
Top Expert 2007

Commented:
dogznbonz: Excellent point. Too bad >Rositta< stopped responding, eh?

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial