Select parent nodes in sitemap when any of its children are selected

Discussion in 'ASP .Net' started by Dave Mathew, Oct 6, 2008.

  1. Dave Mathew

    Dave Mathew Guest

    I'm in the process of building some navigation for a website. I would
    like to use the capabilities of the sitemap in but have ran
    into some styling/usability issues in the past using just the default
    controls that consume the sitemap. I'd like to know of there is a
    correct/recommended way of doing the following:

    1.. Build a horizontal navigation bar with a set of top level

    2. When a child page is selected the parent node on the navigation bar
    should be selected as well

    3. When a child page is selected under the parent node but uses a
    query string or an implied file name it should also select the parent

    Here's some examples:

    -- Problem #1: / and /default.aspx no the the same in the eyes of
    the sitemap
    If I had a parent navigation bar category called Books, then went
    to the sitemap as-is would recognize to
    highlight the books category. I also want this to happen when I go to where Default.aspx is what is loaded by IIS but it
    is not explicitly stated when the user enters the URL, when using the
    default sitemap functionality in the sitemap does not
    recognize that Default.aspx is selected since its not explicitly
    expressed in the url. How would I make and equivalent to the controls consuming
    the sitemap?
    -- Problem #2:
    Let's say that I have the same books category but I also have
    another page called Meetups.aspx under it. When this page is selected
    I also want the books category / parent node to realize it is selected
    and display as such in my navigation bar. I also want parent to select
    when a query string is used on this page. i.e. Meetups.aspx?
    sate=IN&zip=46032 should also highlight the Books parent node and
    ideally would be the same as Meetups.aspx when not using the query
    string. The default sitemap controls don't seem to allow this

    The last time I worked with sitemaps was in .NET 2.0, and I'm now
    using 3.5, didn't know if the support for sitemaps are any better in
    the new version? Is thee a correct way to get this functionality from
    the out of the box controls or will I have to code my own custom
    solution? Any suggestions or references to resources would help.
    Dave Mathew, Oct 6, 2008
    1. Advertisements

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    Thomas Weidenfeller
    Mar 31, 2005
  2. Hannes Heckner
    Martin Honnen
    Oct 13, 2003
  3. Michael Reiche
    Michael Reiche
    Feb 5, 2004
  4. Replies:
    Dr John Stockton
    May 14, 2005
  5. Replies:

Share This Page