XmlSiteMapProvider.RootNode 屬性


取得網站地圖的根節點。Gets the root node of the site map.

 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;如果安全性調整已啟用而且目前的使用者無法存取根節點,則為 nullA 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 當存取屬性時,也會發生任何針對方法所發生的例外狀況 RootNodeTherefore, any exceptions that occur for the BuildSiteMap method can also occur when accessing the RootNode property.

SiteMapProviderXmlSiteMapProvider 類別只允許 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.