views:

467

answers:

0

I'm trying to return all the child nodes of a set of navigation nodes in sharepoint, the SDK implies I should be doing something like this:

NodeColl = objSite.Navigation.TopNavigationBar 
Dim Node as SPNavigationNode

For Each Node In NodeColl
  if Node.IsVisible then
    Response.Write("<siteMapNode url=""" & Node.Url & """ title=""" & Node.Title & """  description=""" & Node.Title & """ >" & Environment.NewLine)
    Dim SubChildNodes as SPNavigationNodeCollection = Node.Children
    Response.Write(SubChildNodes.Count) 'returns 0 always even though I know theres over 20 nodes in some of the sections
    Dim ChildNode as SPNavigationNode
    For Each ChildNode in SubChildNodes
      if ChildNode.IsVisible then
        Response.Write("<siteMapNode url=""" & ChildNode.Url & """ title=""" & ChildNode.Title & """  description=""" & ChildNode.Title & """ />" & Environment.NewLine)
      End if
    Next
    Response.Write("</siteMapNode>" & Environment.NewLine)
  End If
Next

however whenever I do, it lists the top level navigation nodes but I cannot get the children to be displayed.