共用方式為


SPNavigationProvider class

提供基底類別的SharePoint Foundation專門用於 SharePoint 網站 」 導覽的網站導覽提供者。

Inheritance hierarchy

System.Object
  System.Configuration.Provider.ProviderBase
    System.Web.SiteMapProvider
      Microsoft.SharePoint.Navigation.SPNavigationProvider
        Microsoft.SharePoint.Navigation.SPAdministrationQuickLaunchProvider

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

Syntax

'宣告
<AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level := AspNetHostingPermissionLevel.Minimal)> _
<AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level := AspNetHostingPermissionLevel.Minimal)> _
Public Class SPNavigationProvider _
    Inherits SiteMapProvider _
    Implements IEditableSiteMapProvider
'用途
Dim instance As SPNavigationProvider
[AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public class SPNavigationProvider : SiteMapProvider, 
    IEditableSiteMapProvider

備註

衍生自 「 ASP.NET SiteMapProvider類型。

Examples

SPNavigationProvider類別可讓您撰寫自訂控制項來瀏覽網站。下列範例程式碼存取的根節點的上方連結列快速啟動]。從這時,使用者可以瀏覽這兩個節點的階層。

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

SPWeb web = SPControl.GetContextWeb(Context);

SPNavigationProvider prov = (SPNavigationProvider)
      SiteMap.Providers["SPNavigationProvider"];

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

%>
     </BODY>
</HTML>

Thread safety

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

請參閱

參照

SPNavigationProvider members

Microsoft.SharePoint.Navigation namespace

System.Web.SiteMapProvider

System.Configuration.Provider.ProviderBase