PotalSiteMapProvider 不返回页面。我使用如下代码:
PortalSiteMapProvider prov = PortalSiteMapProvider.CurrentNavSiteMapProviderNoEncode;
prov.DynamicChildLimit = 0;
prov.IncludeSubSites = PortalSiteMapProvider.IncludeOption.Always;
prov.IncludePages = PortalSiteMapProvider.IncludeOption.Always;
prov.IncludeHeadings = true;
prov.IncludeAuthoredLinks = true;
SiteMapNode root = prov.RootNode;
//prov.IncludePages = PortalSiteMapProvider.IncludeOption.Always;
SiteMapNodeCollection collection = prov.GetChildNodes(root);
foreach (SiteMapNode thisNode in collection)
{
SiteMapNodeCollection thisCollection;
if (thisNode.GetType() == typeof(PortalWebSiteMapNode))
{
prov.IncludePages = PortalSiteMapProvider.IncludeOption.Always;
thisCollection = prov.GetChildNodes((PortalWebSiteMapNode)thisNode);
}
}
当我通过调试器查看时,thisCollection 从来没有任何子节点,尽管 thisNode 是一个有页面的子站点节点。我做错了什么,如何获取该节点中的页面?谢谢!