SiteMapProvider.GetParentNodeRelativeToCurrentNodeAndHintDownFromParent 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
提供優化的網站地圖提供者查找方法,適用於當前請求頁面的祖先節點並取得祖先後代節點。
public:
virtual System::Web::SiteMapNode ^ GetParentNodeRelativeToCurrentNodeAndHintDownFromParent(int walkupLevels, int relativeDepthFromWalkup);
public virtual System.Web.SiteMapNode GetParentNodeRelativeToCurrentNodeAndHintDownFromParent(int walkupLevels, int relativeDepthFromWalkup);
abstract member GetParentNodeRelativeToCurrentNodeAndHintDownFromParent : int * int -> System.Web.SiteMapNode
override this.GetParentNodeRelativeToCurrentNodeAndHintDownFromParent : int * int -> System.Web.SiteMapNode
Public Overridable Function GetParentNodeRelativeToCurrentNodeAndHintDownFromParent (walkupLevels As Integer, relativeDepthFromWalkup As Integer) As SiteMapNode
參數
- walkupLevels
- Int32
在取得請求祖先節點時,需穿越的祖先節點層級數。
- relativeDepthFromWalkup
- Int32
從目標祖先節點可取得的後代節點層級數。
傳回
SiteMapNode A 代表當前請求頁面的祖先SiteMapNode;否則,null若找不到當前或祖先SiteMapNode或無法回傳給當前使用者,則為 。
例外狀況
walkupLevels 或 relativeDepthFromWalkup 小於0。
備註
該SiteMapProvider類別的預設實作提供非最佳化的方法實作GetParentNodeRelativeToCurrentNodeAndHintDownFromParent,呼叫 and GetCurrentNodeAndHintAncestorNodesHintNeighborhoodNodes 方法;然而,站點地圖提供者可以覆寫該GetParentNodeRelativeToCurrentNodeAndHintDownFromParent方法,並提供利用自訂快取機制回傳祖先節點並執行其他物件的最佳化查找SiteMapNode實作。
該 walkupLevels 參數用來指定在取得目標節點時要遍歷多少層級的父節點與祖先節點。 若等級數少於請求,則 null 會返回。 參數 downLevel 用來指定要從目標祖先節點檢索多少層後代節點。 若偏好,祖先與後代節點可透過 and SiteMapNode 屬性與方法回傳GetParentNodeRelativeToCurrentNodeAndHintDownFromParentParentNode的節點連結ChildNodes。