答案 0 :(得分:2)
如GitHub Wiki上的Advanced Node Visibility所述,您必须将可见性提供程序更改为FilteredSiteMapNodeVisibilityProvider并将“visibility”添加到attributesToIgnore:
<siteMap defaultProvider="MvcSiteMapProvider" enabled="true">
<providers>
<clear />
<add name="MvcSiteMapProvider"
type="MvcSiteMapProvider.DefaultSiteMapProvider, MvcSiteMapProvider"
...
attributesToIgnore="visibility"
...
siteMapNodeVisibilityProvider="MvcSiteMapProvider.FilteredSiteMapNodeVisibilityProvider, MvcSiteMapProvider"
/>
</providers>
</siteMap>
完成此操作后,您必须将visibility属性添加到要隐藏的所有节点。该属性应设置为:
<mvcSiteMapNode title="Only in SiteMap" ... visibility="XmlSiteMapResult,!*" />