Navigation Menu Site Map Difficulties

A

Allen Racho

Hello, all! Great to find this resource.

I have an asp:Menu control on a page that gets its data from a SiteMapDataSource (which in turn draws data from a SQL Server). Everything works well, as expected, WRT normal navigation menu operation.

However, what is the recommended practice -- if there is one -- for easily excluding submenu items so that they don't appear on any menu, but still show up in the SiteMapPath ("breadcrumbs") control?

Let me provide a concrete example. Here's a snippet of the main menu:

[Home] [About] [Contact]

When the user submits a message through the Contact form, one of two results pages are called: Success.aspx or Failure.aspx. In the SiteMap data source, I have made the nodes for these two pages as children of the Contact page node. As such, when called, they appear in the breadcrumb trail as follows:

Home >> Contact >> Success|Failure

However, they also annoyingly appear in the dynamic drop-down under the main menu item for Contact!

You get the idea... So, is there a built-in way to exclude child nodes from appearing under a parent item, but still appear normally in the breadcrumb trail?

Thanks much!

Allen
 
A

Allen Racho

Ward, thanks for the reply. I have actually managed to solve this particular issue by some [read: a lot] of digging around. It involves actively removing items from the menu list (e.g. menu.Items.Remove()) before the menu is rendered. If you want the exact code for this, which appears to work flawlessly (if only for future reference), send me an email at allenrachoATSYMBOLyahooPERIODcom.

Now however, I have run into a another very annoying issue WRT built-in ASP.NET 2.0 menu. I cannot get the menu to reliably highlight active items appropriately!

Example top level menu items:

[Home] [About] [Projects]

Example child menu items:

[About]
-Privacy Policy
-Terms of Use

[Projects]
-Page 1
-Page 2
-Page 3

When selecting the top-level ("parent") menu items, they stay highlighted just fine. Meaning, if you select "Projects", you will land on the Projects page and the appropriate menu item will be highlighted.

However, if you select "Page 2", you will land on the Projects page, and NOTHING will be highlighted, which is slightly disorienting. Ideally and logically the parent menu item (Projects) should be highlighted to give the user a proper sense of place in the site.

Right now, I have a solution that works one way or the other. Either I can get all the parent items to appropriately highlight, or I can get the child items to cause their parent menu items to highlight - but suddenly highlighting the parent menu items themselves stops working.

Any ideas?

Allen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top