SPNavigationProvider 类

提供SharePoint Foundation专用于 SharePoint 网站的导航的站点地图提供程序的基类。

继承层次结构

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

命名空间:  Microsoft.SharePoint.Navigation
程序集:  Microsoft.SharePoint(位于 Microsoft.SharePoint.dll 中)

语法

声明
<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类型。

示例

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>

线程安全性

该类型的任何公共 静态 (已共享 在 Visual Basic 中) 成员都是线程安全的。不保证任何实例成员都是线程安全的。

另请参阅

引用

SPNavigationProvider 成员

Microsoft.SharePoint.Navigation 命名空间

System.Web.SiteMapProvider

System.Configuration.Provider.ProviderBase