Aspnet Treeview limit source page level

Discussion in 'ASP .Net' started by Matt, Feb 15, 2006.

  1. Matt

    Matt Guest

    I have below sitemap as source for treeview that sits on master pages..
    Is there a way to limit source for treeview to page level..
    When i cruise the pages i would like to see only related nodes for that
    page versus see all nodes in every page
    Example would be..
    A.aspx would show only
    a.aspx
    b.aspx
    instead of showing all tree.....?


    <siteMapNode url="Default.aspx" title="Home" description="Home">
    <siteMapNode url="A.aspx" title="A" description="A Desc" />
    <siteMapNode url="a.aspx" title="a" description="a Desc" />
    <siteMapNode url="b.aspx" title="a" description="a Desc" />

    <siteMapNode url="B.aspx" title="B" description="B Desc " />
    <siteMapNode url="C.aspx" title="C" description="C Desc" />
    </siteMapNode>

    </siteMap>
     
    Matt, Feb 15, 2006
    #1
    1. Advertising

  2. Matt

    Teemu Keiski Guest

    Hi,

    you can do something like that if you have a SiteMapDataSource control in
    use. Set StartFromCurrentNode="True" when it would switch the display to
    always start from the Page you are navigating on. Then set
    StartingNodeOffSet="n" where n is the number levels to display up (up or
    down based on do you give negative or positive value)

    Though it seems that your nodes are on the same level-

    --
    Teemu Keiski
    ASP.NET MVP, AspInsider
    Finland, EU
    http://blogs.aspadvice.com/joteke


    "Matt" <> wrote in message
    news:...
    >I have below sitemap as source for treeview that sits on master pages..
    > Is there a way to limit source for treeview to page level..
    > When i cruise the pages i would like to see only related nodes for that
    > page versus see all nodes in every page
    > Example would be..
    > A.aspx would show only
    > a.aspx
    > b.aspx
    > instead of showing all tree.....?
    >
    >
    > <siteMapNode url="Default.aspx" title="Home" description="Home">
    > <siteMapNode url="A.aspx" title="A" description="A Desc" />
    > <siteMapNode url="a.aspx" title="a" description="a Desc" />
    > <siteMapNode url="b.aspx" title="a" description="a Desc" />
    >
    > <siteMapNode url="B.aspx" title="B" description="B Desc " />
    > <siteMapNode url="C.aspx" title="C" description="C Desc" />
    > </siteMapNode>
    >
    > </siteMap>
    >
     
    Teemu Keiski, Feb 15, 2006
    #2
    1. Advertising

  3. Matt

    Matt Guest

    Owesome
    Thank you.
     
    Matt, Feb 15, 2006
    #3
    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:
    2
    Views:
    452
  2. Gary Nelson

    Upgrade from aspnet 1.1 to aspnet 2.0

    Gary Nelson, Oct 14, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    496
    Gary Nelson
    Oct 14, 2005
  3. =?Utf-8?B?Sm9l?=

    page-level vs control-level enableViewState

    =?Utf-8?B?Sm9l?=, Oct 26, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    2,946
    S. Justin Gengo
    Oct 26, 2005
  4. pabbu
    Replies:
    8
    Views:
    745
    Marc Boyer
    Nov 7, 2005
  5. Replies:
    1
    Views:
    1,099
    Victor Bazarov
    Jun 28, 2005
Loading...

Share This Page