+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / SiteMap.RootNode.HasChildNodes returning False

SiteMap.RootNode.HasChildNodes returning False

3 posts, 1 answered
  1. Ben
    Ben avatar
    2 posts
    Registered:
    28 Jun 2010
    08 Sep 2010
    Link to this post
    Hi All,
    I'm having an issue trying to retrieve my top level nodes. The code I'm using is:
    For Each node As SiteMapNode In SiteMap.RootNode.ChildNodes
         Response.Write(node.Url)
    Next
    or this:
    For Each childNode As Telerik.Cms.Web.CmsSiteMapNode In SiteMap.RootNode.ChildNodes
         Response.Write(childNode.Url)
    Next

    I've also tried:
    Response.Write(SiteMap.RootNode.HasChildNodes.ToString)
    and this returns false.

    I've seen examples doing exactly what I'm attempting to do. Any ideas where I'm going wrong?

    Thanks,
    Ben
  2. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    08 Sep 2010
    Link to this post
    Hello Ben,

    Thank you for using our services.

    The site map is built from pages set as navigable. Also pages with restrictions - such as deny anonymous or view permission restrictions will not be included in the site map for the current user. If your pages are set as non navigable HasChildren method will return false.

    Sincerely yours,
    Radoslav Georgiev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
    Answered
  3. Ben
    Ben avatar
    2 posts
    Registered:
    28 Jun 2010
    08 Sep 2010
    Link to this post
    Hi Radoslav,
    Thanks for your quick reply! I feel like a total novice for missing that one. I completely overlooked the navigable property for my top level pages as I'm doing some custom navigation for the second level down. Thanks again!

    Best Regards,
    Ben
Register for webinar
3 posts, 1 answered