SiteMapProvider.GetCurrentNodeAndHintNeighborhoodNodes Method (Int32, Int32)
Provides an optimized lookup method for site map providers when retrieving the node for the currently requested page and fetching the site map nodes in the proximity of the current node.
Assembly: System.Web (in System.Web.dll)
public virtual SiteMapNode GetCurrentNodeAndHintNeighborhoodNodes( int upLevel, int downLevel )
The number of ancestor SiteMapNode generations to fetch. 0 indicates no ancestor nodes are retrieved and -1 indicates that all ancestors might be retrieved and cached by the provider.
The default implementation of the CurrentNode property; however, site map providers can override the method and provide an optimized implementation that uses custom caching mechanisms to return the current SiteMapNode object, as well as SiteMapNode objects that are in the proximity of the current SiteMapNode.method returns the
The upLevel parameter is used to specify how many levels of parent and ancestor nodes to retrieve and cache, along with their immediate children. The downLevel parameter is used to specify how many levels of descendant nodes from the current SiteMapNode to retrieve. If preferred, the ancestor and descendant nodes can be linked to the SiteMapNode that is returned by the
The XmlSiteMapProvider class, which is the default site map provider for ASP.NET, caches the entire site map in memory, which results in little or no overhead when querying the XmlSiteMapProvider for specific SiteMapNode objects.
Available since 2.0