XmlSiteMapProvider.RootNode 属性
定义
获取站点地图的根节点。Gets the root node of the site map.
public:
virtual property System::Web::SiteMapNode ^ RootNode { System::Web::SiteMapNode ^ get(); };
public override System.Web.SiteMapNode RootNode { get; }
member this.RootNode : System.Web.SiteMapNode
Public Overrides ReadOnly Property RootNode As SiteMapNode
属性值
表示站点地图根节点的 SiteMapNode;如果启用了安全修整并且根节点对于当前用户不可访问,则为 null。A SiteMapNode that represents the root node of the site map; otherwise, null, if security trimming is enabled and the root node is not accessible to the current user.
注解
RootNode属性调用 BuildSiteMap 方法来检索站点地图中的顶级节点。The RootNode property calls the BuildSiteMap method to retrieve the top-level node in the site map. 因此, BuildSiteMap 在访问该属性时,也可能发生该方法发生的任何异常 RootNode 。Therefore, any exceptions that occur for the BuildSiteMap method can also occur when accessing the RootNode property.
SiteMapProvider和 XmlSiteMapProvider 类仅允许站点地图中有一个根 SiteMapNode 对象。The SiteMapProvider and XmlSiteMapProvider classes permit only one root SiteMapNode object in a site map. XmlSiteMapProvider类将重写抽象 SiteMapProvider.RootNode 属性,并提供一个用于跟踪根节点的简单实现。The XmlSiteMapProvider class overrides the abstract SiteMapProvider.RootNode property and provides a simple implementation to track the root node.