Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3
This is the forum to discuss the Wrox book Beginning ASP.NET 3.5: In C# and VB by Imar Spaanjaars; ISBN: 9780470187593
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 7th, 2009, 06:07 AM
Authorized User
 
Join Date: Jun 2009
Posts: 70
Thanks: 18
Thanked 1 Time in 1 Post
Default Chapter 7: combine Menu and SiteMapPath controls?

I would very much like to highlight the current page by a method other than breadcrumb. For example, in the Monochrome theme, if the current page is the home page, give a different background to 'Home' on the menu (and, ideally, disable the link). Is it possible to combine the Menu and SiteMapPath controls to achieve that? Or is there some other way?
 
Old November 7th, 2009, 06:18 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

This should already be the case. Active menu items end up with a green background. This is done with the StaticSelectedStyle:

Code:
 
<asp:Menu ID="Menu1" runat="server" CssClass="MainMenu"  ... >
<StaticSelectedStyle CssClass="StaticSelectedStyle" />
...
</asp:Menu>
and this CSS:

Code:
 
.StaticHoverStyle, .StaticSelectedStyle
{
  /* Defines the look of active and hover menu items */
  background-color: #c1e4ce;
}
You can do the same for the sub menus:

Quote:
<DynamicSelectedStyle CssClass="SomeClass" />
with this CSS

Code:
 
.SomeClass
{
  background-color: red;
}
Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
The Following User Says Thank You to Imar For This Useful Post:
kiwibrit (November 7th, 2009)
 
Old November 7th, 2009, 06:35 AM
Authorized User
 
Join Date: Jun 2009
Posts: 70
Thanks: 18
Thanked 1 Time in 1 Post
Default

Ooops. So it does. Thanks for such a quick response. My apologies for not being more thorough before I posted.

OK, given that's possible, I shall now have a go with CSS friendly control adapters. Since the book was written, it maybe a little bit harder for novices like me to get into that - in that the Microsoft page pops you across to a codeplex page when you try to download - and the package no longer has vis installation. However, I think I am sorting it - I'll drop a note in this forum if it all works out, as a sort of supplement to the note on CSS Control adapters on page 264.





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to create SiteMapPath in PHP? firblazer PHP How-To 0 July 14th, 2008 09:33 PM
CMS: Bind Nav Data to Treeview/Menu controls bullwinkle BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 3 October 25th, 2007 02:33 PM
Wrox CMS - Altering the menu controls Eriskyne BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 3 October 15th, 2007 12:34 PM
SiteMapPath Control Question lcsgeek BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 6 February 7th, 2006 06:18 PM
Menu hiding under controls arnabghosh Classic ASP Basics 2 June 17th, 2005 06:15 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.