Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Nov 15, 2012 12:57 AM by Amy Peng - MSFT
Member
2 Points
15 Posts
Nov 11, 2012 08:51 PM|LINK
Here is my simplified markup
<asp:Menu ID="MyMenu" runat="server" ClientIDMode="Static" StaticDisplayLevels="2" RenderingMode="List"> <LevelMenuItemStyles> <asp:MenuItemStyle CssClass="mlvl1" /> <asp:MenuItemStyle CssClass="mlvl2" /> </LevelMenuItemStyles> <LevelSelectedStyles> <asp:MenuItemStyle CssClass="mlvl1_sel" /> <asp:MenuItemStyle CssClass="mlvl2_sel" /> </LevelSelectedStyles> </asp:Menu>
At the final HTML, I expect "mlvl1_sel" or "mlvl2_sel" css class for the selected menu item.
But it goes like this
<a class="level2 mlvl2 selected static" href=".......some url....." />
How can I make use of the "selected" attribute's value where I already have css name "mlvl2_sel" ?
Participant
1742 Points
360 Posts
Nov 11, 2012 09:25 PM|LINK
http://msdn.microsoft.com/en-us/library/ms366731.aspx
http://www.codeproject.com/Articles/47515/ASP-NET-Horizontal-Menu-Control
All-Star
42936 Points
7023 Posts
MVP
Nov 12, 2012 10:08 AM|LINK
Hello,
khun_panya How can I make use of the "selected" attribute's value where I already have css name "mlvl2_sel" ?
Add the !important tag for the styles in the selected class. For example:
.selected { color: #0049B2 !important; }
Please 'Mark as Answer' if this post helps you.
Star
10122 Points
958 Posts
Microsoft
Nov 15, 2012 12:57 AM|LINK
Hi,
Try to add this in the <asp:Menu>:
<StaticSelectedStyle CssClass="mlvl2_sel" />
For more details, please try refer to: Menu.StaticSelectedStyle: http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.menu.staticselectedstyle.aspx .
Thanks, Amy Peng
khun_panya
Member
2 Points
15 Posts
How to specify CssClass for the "Selected" menu item
Nov 11, 2012 08:51 PM|LINK
Here is my simplified markup
<asp:Menu ID="MyMenu" runat="server" ClientIDMode="Static" StaticDisplayLevels="2" RenderingMode="List"> <LevelMenuItemStyles> <asp:MenuItemStyle CssClass="mlvl1" /> <asp:MenuItemStyle CssClass="mlvl2" /> </LevelMenuItemStyles> <LevelSelectedStyles> <asp:MenuItemStyle CssClass="mlvl1_sel" /> <asp:MenuItemStyle CssClass="mlvl2_sel" /> </LevelSelectedStyles> </asp:Menu>At the final HTML, I expect "mlvl1_sel" or "mlvl2_sel" css class for the selected menu item.
But it goes like this
How can I make use of the "selected" attribute's value where I already have css name "mlvl2_sel" ?
Alsaady
Participant
1742 Points
360 Posts
Re: How to specify CssClass for the "Selected" menu item
Nov 11, 2012 09:25 PM|LINK
http://msdn.microsoft.com/en-us/library/ms366731.aspx
http://www.codeproject.com/Articles/47515/ASP-NET-Horizontal-Menu-Control
www.rtoosh.net
Ruchira
All-Star
42936 Points
7023 Posts
MVP
Re: How to specify CssClass for the "Selected" menu item
Nov 12, 2012 10:08 AM|LINK
Hello,
Add the !important tag for the styles in the selected class. For example:
.selected { color: #0049B2 !important; }
My Tech blog | My YouTube ChannelPlease 'Mark as Answer' if this post helps you.Amy Peng - M...
Star
10122 Points
958 Posts
Microsoft
Re: How to specify CssClass for the "Selected" menu item
Nov 15, 2012 12:57 AM|LINK
Hi,
Try to add this in the <asp:Menu>:
For more details, please try refer to: Menu.StaticSelectedStyle: http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.menu.staticselectedstyle.aspx .
Thanks,
Amy Peng
Feedback to us
Develop and promote your apps in Windows Store