SPNavigationProvider class

Provides a base class for SharePoint Foundation site-map providers that is specialized for SharePoint site navigation.

Namespace:  Microsoft.SharePoint.Navigation
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

[AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public class SPNavigationProvider : SiteMapProvider, 

Derives from the ASP.NET SiteMapProvider type.

The SPNavigationProvider class allows you to write custom controls to navigate a site. The following sample code accesses the root node for the Top Link Bar and Quick Launch. From that point, a user can navigate both node hierarchies.

<% @Page language="C#" Debug=true%>
<%@ Register Tagprefix="SharePoint" 
      Assembly="Microsoft.Sharepoint" %>
<%@ Register Tagprefix="SharePointNavigation"
      Assembly="Microsoft.Sharepoint" %>
<%@ Register Tagprefix="SharePointWebControls"
      Assembly="Microsoft.Sharepoint" %>
            Tests the SPNavigationProvider properties

SPWeb web = SPControl.GetContextWeb(Context);

SPNavigationProvider prov = (SPNavigationProvider)

Response.Write ("<BR><DIV ID =\"quicklaunch\">" +
       prov.FindSiteMapNode(Context).Title + "</DIV>");
Response.Write("<BR><DIV ID=\"toplink\">" +
      prov.FindSiteMapNode("sid:1002") + "</DIV>");


Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.