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 asp.net 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
    navigation

    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
    node.

    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 example.com/Books/Default.aspx the sitemap as-is would recognize to
    highlight the books category. I also want this to happen when I go to
    example.com/Books 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 asp.net the sitemap does not
    recognize that Default.aspx is selected since its not explicitly
    expressed in the url. How would I make example.com/Books and
    example.com/Books/Default.aspx 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 asp.net sitemap controls don't seem to allow this
    either.


    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.
    Thanks!
    Dave Mathew, Oct 6, 2008
    #1
    1. Advertising

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:
    1
    Views:
    3,956
    Thomas Weidenfeller
    Mar 31, 2005
  2. Hannes Heckner
    Replies:
    1
    Views:
    759
    Martin Honnen
    Oct 13, 2003
  3. Michael Reiche
    Replies:
    3
    Views:
    10,823
    Michael Reiche
    Feb 5, 2004
  4. Replies:
    4
    Views:
    104
    Dr John Stockton
    May 14, 2005
  5. Replies:
    0
    Views:
    130
Loading...

Share This Page