p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 7th, 2009, 06:07 AM
Authorized User
Points: 208, Level: 4
Points: 208, Level: 4 Points: 208, Level: 4 Points: 208, Level: 4
Activity: 43%
Activity: 43% Activity: 43% Activity: 43%
 
Join Date: Jun 2009
Posts: 48
Thanks: 14
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?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old November 7th, 2009, 06:18 AM
Imar's Avatar
Wrox Author
Points: 33,554, Level: 80
Points: 33,554, Level: 80 Points: 33,554, Level: 80 Points: 33,554, Level: 80
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 10,228
Thanks: 7
Thanked 203 Times in 201 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
Everyone is unique, except for me.
Author of Beginning ASP.NET 3.5 : in C# and VB, ASP.NET 2.0 Instant Results and Dreamweaver MX 2004

Did this post help you? Click the button to show your appreciation!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
The Following User Says Thank You to Imar For This Useful Post:
kiwibrit (November 7th, 2009)
  #3 (permalink)  
Old November 7th, 2009, 06:35 AM
Authorized User
Points: 208, Level: 4
Points: 208, Level: 4 Points: 208, Level: 4 Points: 208, Level: 4
Activity: 43%
Activity: 43% Activity: 43% Activity: 43%
 
Join Date: Jun 2009
Posts: 48
Thanks: 14
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to create SiteMapPath in PHP? firblazer PHP How-To 0 July 14th, 2008 10: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 03: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 01: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 07:15 PM



All times are GMT -4. The time now is 03:20 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc