我试图返回一组在SharePoint导航节点的所有子节点,该SDK意味着我应该做这样的事情:MOSS SpNavigationNode.Children总是空
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
但是每当我做,它列出了顶级导航节点,但我无法让孩子显示。
原来isVisible属性总是错误的... – Mauro 2012-08-01 14:28:26