Bagikan melalui


StaticSiteMapProvider Kelas

Definisi

Berfungsi sebagai implementasi parsial dari kelas abstrak SiteMapProvider dan berfungsi sebagai kelas dasar untuk XmlSiteMapProvider kelas , yang merupakan penyedia peta situs default di ASP.NET.

public ref class StaticSiteMapProvider abstract : System::Web::SiteMapProvider
public abstract class StaticSiteMapProvider : System.Web.SiteMapProvider
type StaticSiteMapProvider = class
    inherit SiteMapProvider
Public MustInherit Class StaticSiteMapProvider
Inherits SiteMapProvider
Warisan
StaticSiteMapProvider
Turunan

Contoh

Contoh kode berikut menunjukkan cara Anda memperluas StaticSiteMapProvider kelas untuk menggunakan Microsoft Access sebagai penyedia peta situs. Kelas AccessSiteMapProvider ini adalah penyedia peta situs yang hanya mendukung hierarki satu tingkat yang sederhana. Tabel tempat data peta situs disimpan memiliki struktur berikut:

NODEID URL            NAME       PARENTNODEID  
 ---------------------------------------------  
 1      default.aspx   Default    <NULL>  
 2      catalog.aspx   Catalog    1  
 3      aboutus.aspx   Contact Us 1  
...  

Kelas AccessSiteMapProvider ini berasal dari StaticSiteMapProvider kelas dan mengambil informasinya dari database Microsoft Access menggunakan kueri SQL dasar dan OleDbCommand objek dan OleDbDataReader .

#using <System.Data.dll>
#using <System.Transactions.dll>
#using <System.EnterpriseServices.dll>
#using <System.dll>
#using <System.Web.dll>
#using <System.Configuration.dll>

using namespace System;
using namespace System::Collections;
using namespace System::Collections::Specialized;
using namespace System::Configuration;
using namespace System::Data;
using namespace System::Data::OleDb;
using namespace System::Security::Permissions;
using namespace System::Web;

/// An extremely simple AccessSiteMapProvider that only supports a
/// site map node hierarchy 1 level deep.

[AspNetHostingPermission(SecurityAction::Demand,Level=AspNetHostingPermissionLevel::Minimal)]
public ref class AccessSiteMapProvider: public StaticSiteMapProvider
{
private:
   SiteMapNode ^ rootNode;
   OleDbConnection^ accessConnection;

   // This string is case sensitive.
   String^ AccessConnectionStringName;

public:
   // Implement a default constructor.
   AccessSiteMapProvider()
   {
      initialized = false;
      AccessConnectionStringName = "accessSiteMapConnectionString";
   }


private:

   // Some basic state to help track the initialization state of the provider.
   bool initialized;

public:

   property bool IsInitialized 
   {
      virtual bool get()
      {
         return initialized;
      }

   }

   property SiteMapNode ^ RootNode 
   {

      // Return the root node of the current site map.
      virtual SiteMapNode ^ get() override
      {
         SiteMapNode ^ temp = nullptr;
         temp = BuildSiteMap();
         return temp;
      }

   }

protected:

   virtual SiteMapNode ^ GetRootNodeCore() override
   {
      return RootNode;
   }


public:

   // Initialize is used to initialize the properties and any state that the
   // AccessProvider holds, but is not used to build the site map.
   // The site map is built when the BuildSiteMap method is called.
   virtual void Initialize( String^ name, NameValueCollection^ attributes ) override
   {
      if ( IsInitialized )
            return;

      StaticSiteMapProvider::Initialize( name, attributes );
      
      // Create and test the connection to the Microsoft Access database.
      // Retrieve the Value of the Access connection string from the
      // attributes NameValueCollection.
      String^ connectionString = attributes[ AccessConnectionStringName ];
      if ( nullptr == connectionString || connectionString->Length == 0 )
            throw gcnew Exception( "The connection string was not found." );
      else
            accessConnection = gcnew OleDbConnection( connectionString );

      initialized = true;
   }


protected:

   ///
   /// SiteMapProvider and StaticSiteMapProvider methods that this derived class must override.
   ///
   // Clean up any collections or other state that an instance of this may hold.
   virtual void Clear() override
   {
      System::Threading::Monitor::Enter( this );
      try
      {
         rootNode = nullptr;
         StaticSiteMapProvider::Clear();
      }
      finally
      {
         System::Threading::Monitor::Exit( this );
      }

   }


public:

   // Build an in-memory representation from persistent
   // storage, and return the root node of the site map.
   virtual SiteMapNode ^ BuildSiteMap() override
   {
      // Since the SiteMap class is static, make sure that it is
      // not modified while the site map is built.
      System::Threading::Monitor::Enter( this );
      try
      {
         
         // If there is no initialization, this method is being
         // called out of order.
         if (  !IsInitialized )
         {
            throw gcnew Exception( "BuildSiteMap called incorrectly." );
         }
         
         // If there is no root node, then there is no site map.
         if ( nullptr == rootNode )
         {
            
            // Start with a clean slate
            Clear();
            
            // Select the root node of the site map from Microsoft Access.
            int rootNodeId = -1;
            if ( accessConnection->State == ConnectionState::Closed )
               accessConnection->Open();
            
            OleDbCommand^ rootNodeCommand = gcnew OleDbCommand
               ("SELECT nodeid, url, name FROM SiteMap WHERE parentnodeid IS NULL", accessConnection);
            OleDbDataReader^ rootNodeReader = rootNodeCommand->ExecuteReader();
            if ( rootNodeReader->HasRows )
            {
               rootNodeReader->Read();
               rootNodeId = rootNodeReader->GetInt32( 0 );
               
               // Create a SiteMapNode that references the current StaticSiteMapProvider.
               rootNode = gcnew SiteMapNode(this, rootNodeId.ToString(), 
                  rootNodeReader->GetString( 1 ),rootNodeReader->GetString( 2 ));
            }
            else
               return nullptr;
            rootNodeReader->Close();
            
            // Select the child nodes of the root node.
            OleDbCommand^ childNodesCommand = gcnew OleDbCommand
               ("SELECT nodeid, url, name FROM SiteMap WHERE parentnodeid = ?", accessConnection);
            OleDbParameter^ rootParam = gcnew OleDbParameter( "parentid", OleDbType::Integer);
            rootParam->Value = rootNodeId;
            childNodesCommand->Parameters->Add( rootParam );
            OleDbDataReader^ childNodesReader = childNodesCommand->ExecuteReader();
            if ( childNodesReader->HasRows )
            {
               SiteMapNode ^ childNode = nullptr;
               while ( childNodesReader->Read() )
               {
                  childNode = gcnew SiteMapNode( this, 
                      System::Convert::ToString(childNodesReader->GetInt32( 0 )),
                     childNodesReader->GetString( 1 ),
                     childNodesReader->GetString( 2 ) 
                  );
                  // Use the SiteMapNode AddNode method to add
                  // the SiteMapNode to the ChildNodes collection.
                  AddNode( childNode, rootNode );
               }
            }
            childNodesReader->Close();
            accessConnection->Close();
         }
         return rootNode;
      }
      finally
      {
         System::Threading::Monitor::Exit( this );
      }

   }

};
namespace Samples.AspNet.CS.Controls {

    using System;
    using System.Collections;
    using System.Collections.Specialized;
    using System.Data;
    using System.Data.OleDb;
    using System.Security.Permissions;
    using System.Web;

    /// An extremely simple AccessSiteMapProvider that only supports a
    /// site map node hierarchy 1 level deep.
    [AspNetHostingPermission(SecurityAction.Demand, Level=AspNetHostingPermissionLevel.Minimal)]
    public class AccessSiteMapProvider : StaticSiteMapProvider
    {
        private SiteMapNode rootNode =  null;
        private OleDbConnection accessConnection = null;

        // This string is case sensitive.
        private string AccessConnectionStringName = "accessSiteMapConnectionString";

        // Implement a default constructor.
        public AccessSiteMapProvider () { }

        // Some basic state to help track the initialization state of the provider.
        private bool initialized = false;
        public virtual bool IsInitialized {
            get {
                return initialized;
            }
        }
        // Return the root node of the current site map.
        public override SiteMapNode RootNode {
            get {
                SiteMapNode temp = null;
                temp = BuildSiteMap();
                return temp;
            }
        }
        protected override SiteMapNode GetRootNodeCore() {
            return RootNode;
        }
        // Initialize is used to initialize the properties and any state that the
        // AccessProvider holds, but is not used to build the site map.
        // The site map is built when the BuildSiteMap method is called.
        public override void Initialize(string name, NameValueCollection attributes) {
            if (IsInitialized)
                return;

            base.Initialize(name, attributes);

            // Create and test the connection to the Microsoft Access database.

            // Retrieve the Value of the Access connection string from the
            // attributes NameValueCollection.
            string connectionString = attributes[AccessConnectionStringName];

            if (null == connectionString || connectionString.Length == 0)
                throw new Exception ("The connection string was not found.");
            else
                accessConnection = new OleDbConnection(connectionString);

            initialized = true;
        }

        ///
        /// SiteMapProvider and StaticSiteMapProvider methods that this derived class must override.
        ///
        // Clean up any collections or other state that an instance of this may hold.
        protected override void Clear() {
            lock (this) {
                rootNode = null;
                base.Clear();
            }
        }

        // Build an in-memory representation from persistent
        // storage, and return the root node of the site map.
        public override SiteMapNode BuildSiteMap() {

            // Since the SiteMap class is static, make sure that it is
            // not modified while the site map is built.
            lock(this) {

                // If there is no initialization, this method is being
                // called out of order.
                if (! IsInitialized) {
                    throw new Exception("BuildSiteMap called incorrectly.");
                }

                // If there is no root node, then there is no site map.
                if (null == rootNode) {
                    // Start with a clean slate
                    Clear();

                    // Select the root node of the site map from Microsoft Access.
                    int rootNodeId = -1;

                    if (accessConnection.State == ConnectionState.Closed)
                        accessConnection.Open();
                    OleDbCommand rootNodeCommand =
                        new OleDbCommand("SELECT nodeid, url, name FROM SiteMap WHERE parentnodeid IS NULL",
                                         accessConnection);
                    OleDbDataReader rootNodeReader = rootNodeCommand.ExecuteReader();

                    if(rootNodeReader.HasRows) {
                        rootNodeReader.Read();
                        rootNodeId = rootNodeReader.GetInt32(0);
                        // Create a SiteMapNode that references the current StaticSiteMapProvider.
                        rootNode   = new SiteMapNode(this,
                                                     rootNodeId.ToString(),
                                                     rootNodeReader.GetString(1),
                                                     rootNodeReader.GetString(2));
                    }
                    else
                    {
                        return null;
                    }

                    rootNodeReader.Close();
                    // Select the child nodes of the root node.
                    OleDbCommand childNodesCommand =
                        new OleDbCommand("SELECT nodeid, url, name FROM SiteMap WHERE parentnodeid = ?",
                                         accessConnection);
                    OleDbParameter rootParam = new OleDbParameter("parentid", OleDbType.Integer);
                    rootParam.Value = rootNodeId;
                    childNodesCommand.Parameters.Add(rootParam);

                    OleDbDataReader childNodesReader = childNodesCommand.ExecuteReader();

                    if (childNodesReader.HasRows) {

                        SiteMapNode childNode = null;
                        while(childNodesReader.Read()) {
                            childNode =  new SiteMapNode(this,
                                                         childNodesReader.GetInt32(0).ToString(),
                                                         childNodesReader.GetString(1),
                                                         childNodesReader.GetString(2));

                            // Use the SiteMapNode AddNode method to add
                            // the SiteMapNode to the ChildNodes collection.
                            AddNode(childNode, rootNode);
                        }
                    }

                    childNodesReader.Close();
                    accessConnection.Close();
                }
                return rootNode;
            }
        }
    }
}
Imports System.Collections
Imports System.Collections.Specialized
Imports System.Data
Imports System.Data.OleDb
Imports System.Security.Permissions
Imports System.Web

Namespace Samples.AspNet.VB.Controls
 
    ' An extremely simple AccessSiteMapProvider that only supports a
    ' site map node hierarchy one level deep.
    <AspNetHostingPermission(SecurityAction.Demand, Level:=AspNetHostingPermissionLevel.Minimal)> _
    Public Class AccessSiteMapProvider
        Inherits StaticSiteMapProvider

        Private aRootNode As SiteMapNode = Nothing
        Private accessConnection As OleDbConnection = Nothing

        ' This string is case sensitive.
        Private AccessConnectionStringName As String = "accessSiteMapConnectionString"

        ' Implement a default constructor.
        Public Sub New()
        End Sub

        ' Some basic state to help track the initialization state of the provider.
        Private initialized As Boolean = False

        Public Overridable ReadOnly Property IsInitialized() As Boolean
            Get
                Return initialized
            End Get
        End Property

        ' Return the root node of the current site map.
        Public Overrides ReadOnly Property RootNode() As SiteMapNode
            Get
                Return BuildSiteMap()
            End Get
        End Property

        Protected Overrides Function GetRootNodeCore() As SiteMapNode
            Return RootNode
        End Function

        ' Initialize is used to initialize the properties and any state that the
        ' AccessProvider holds, but is not used to build the site map.
        ' The site map is built when the BuildSiteMap method is called.
        Public Overrides Sub Initialize(ByVal name As String, ByVal attributes As NameValueCollection)
            If IsInitialized Then
                Return
            End If
            MyBase.Initialize(name, attributes)

            ' Create and test the connection to the Microsoft Access database.
            ' Retrieve the Value of the Access connection string from the
            ' attributes NameValueCollection.
            Dim connectionString As String = attributes(AccessConnectionStringName)

            If Nothing = connectionString OrElse connectionString.Length = 0 Then
                Throw New Exception("The connection string was not found.")
            Else
                accessConnection = New OleDbConnection(connectionString)
            End If
            initialized = True
        End Sub

        ' SiteMapProvider and StaticSiteMapProvider methods that this derived class must override.
        '
        ' Clean up any collections or other state that an instance of this may hold.
        Protected Overrides Sub Clear()
            SyncLock Me
                aRootNode = Nothing
                MyBase.Clear()
            End SyncLock
        End Sub

        ' Build an in-memory representation from persistent
        ' storage, and return the root node of the site map.
        Public Overrides Function BuildSiteMap() As SiteMapNode

            ' Since the SiteMap class is static, make sure that it is
            ' not modified while the site map is built.
            SyncLock Me

                ' If there is no initialization, this method is being
                ' called out of order.
                If Not IsInitialized Then
                    Throw New Exception("BuildSiteMap called incorrectly.")
                End If

                ' If there is no root node, then there is no site map.
                If aRootNode Is Nothing Then
                    ' Start with a clean slate
                    Clear()

                    ' Select the root node of the site map from Microsoft Access.
                    Dim rootNodeId As Integer = -1

                    If accessConnection.State = ConnectionState.Closed Then
                        accessConnection.Open()
                    End If
                    Dim rootNodeCommand As New OleDbCommand("SELECT nodeid, url, name FROM SiteMap WHERE parentnodeid IS NULL", accessConnection)
                    Dim rootNodeReader As OleDbDataReader = rootNodeCommand.ExecuteReader()

                    If rootNodeReader.HasRows Then
                        rootNodeReader.Read()
                        rootNodeId = rootNodeReader.GetInt32(0)
                        ' Create a SiteMapNode that references the current StaticSiteMapProvider.
                        aRootNode = New SiteMapNode(Me, rootNodeId.ToString(), rootNodeReader.GetString(1), rootNodeReader.GetString(2))
                    Else
                        Return Nothing
                    End If
                    rootNodeReader.Close()
                    ' Select the child nodes of the root node.
                    Dim childNodesCommand As New OleDbCommand("SELECT nodeid, url, name FROM SiteMap WHERE parentnodeid = ?", accessConnection)
                    Dim rootParam As New OleDbParameter("parentid", OleDbType.Integer)
                    rootParam.Value = rootNodeId
                    childNodesCommand.Parameters.Add(rootParam)

                    Dim childNodesReader As OleDbDataReader = childNodesCommand.ExecuteReader()

                    If childNodesReader.HasRows Then

                        Dim childNode As SiteMapNode = Nothing
                        While childNodesReader.Read()
                            childNode = New SiteMapNode(Me, _
                            childNodesReader.GetInt32(0).ToString(), _
                            childNodesReader.GetString(1), _
                            childNodesReader.GetString(2))

                            ' Use the SiteMapNode AddNode method to add
                            ' the SiteMapNode to the ChildNodes collection.
                            AddNode(childNode, aRootNode)
                        End While
                    End If

                    childNodesReader.Close()
                    accessConnection.Close()
                End If
                Return aRootNode
            End SyncLock

        End Function 'BuildSiteMap

    End Class

End Namespace

Terakhir, dikonfigurasi AccessSiteMapProvider sebagai penyedia default dalam file Web.config berikut.

<configuration>  
  <system.web>  
    <siteMap defaultProvider="AccessSiteMapProvider">  
     <providers>  
       <add   
         name="AccessSiteMapProvider"  
         type="Samples.AspNet.AccessSiteMapProvider,Samples.AspNet "  
         accessSiteMapConnectionString="PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=sitemap.mdb "/>  
     </providers>   
    </siteMap>  
  </system.web>  
</configuration>  

Keterangan

Kelas StaticSiteMapProvider ini adalah implementasi parsial dari kelas abstrak SiteMapProvider dan memasok dua metode tambahan: AddNode dan RemoveNode, serta metode abstrak BuildSiteMap dan dilindungi Clear .

Kelas StaticSiteMapProvider ini mendukung penulisan penyedia peta situs (misalnya, ) XmlSiteMapProvideryang menerjemahkan peta situs yang disimpan dalam penyimpanan persisten ke yang disimpan dalam memori. Kelas ini StaticSiteMapProvider menyediakan implementasi dasar untuk menyimpan dan mengambil SiteMapNode objek.

Kelas SiteMapProvider dan StaticSiteMapProvider mendukung konsep hierarki penyedia peta situs, di mana penyedia peta situs dapat memiliki hubungan hierarkis dengan penyedia peta situs lainnya. Pola ini diimplementasikan dengan RootProvider properti dan ParentProvider .

Kelas StaticSiteMapProvider menyimpan objeknya SiteMapNode dalam tabel hash dan secara internal menggunakan SiteMapNode.Url properti halaman, yang diwakili oleh simpul peta situs, sebagai kunci. (Jika simpul peta situs tidak menentukan URL, simpul tersebut dilacak menggunakan kunci unik yang dihasilkan secara otomatis.) Akibatnya, Anda tidak dapat memiliki simpul peta situs di mana simpul peta situs dengan URL yang sama digunakan lebih dari sekali. Misalnya, mencoba memuat simpul peta situs yang diilustrasikan dalam contoh kode berikut dengan XmlSiteMapProvider kelas , yang merupakan penyedia peta situs ASP.NET default, atau penyedia peta situs apa pun yang berasal dari StaticSiteMapProvider kelas tidak akan berfungsi karena halaman AboutUs.aspx digunakan lebih dari sekali.

<sitemap>  
  <sitemapnode title="Home" description="Home" url="default.aspx" >  
    <sitemapnode title="Catalog" description="Our catalog" url="catalog.aspx"/>  
    <sitemapnode title="About Us" description="All about our company" url="aboutus.aspx"/>  
    <sitemapnode title="Driving Directions" description="Directions to our store" url="aboutus.aspx"/>  
  </sitemapnode>  
</sitemap>  

Jika Anda memperluas kelas, tiga metode terpenting StaticSiteMapProvider adalah GetRootNodeCoremetode , Initialize, dan BuildSiteMap . Metode Clear dan FindSiteMapNode memiliki implementasi default yang cukup untuk sebagian besar implementasi penyedia peta situs kustom.

Metode Initialize ini dipanggil untuk menginisialisasi penyedia peta situs turunan, termasuk sumber daya apa pun yang diperlukan untuk memuat data peta situs, tetapi memang mencoba membangun simpul peta situs dalam memori. Jika kelas turunan Anda menggunakan file untuk menyimpan data peta situs, inisialisasi file apa pun dapat dilakukan di sini. Jika simpul peta situs menggunakan beberapa jenis penyimpanan data lainnya, seperti database relasional, menginisialisasi koneksi mungkin dilakukan di sini. Atribut tambahan, seperti nama file atau string koneksi yang ditempatkan pada elemen penyedia peta situs dalam konfigurasi diproses oleh sistem konfigurasi ASP.NET dan diteruskan ke Initialize metode dengan attributes parameter .

Metode BuildSiteMap harus ditimpa oleh semua kelas yang berasal dari StaticSiteMapProvider kelas dan dipanggil untuk memuat simpul peta situs dari penyimpanan persisten dan mengonversinya menjadi representasi internal. Metode BuildSiteMap ini dipanggil secara internal di banyak implementasi anggota default dari StaticSiteMapProvider kelas dan XmlSiteMapProvider . Jika Anda menerapkan penyedia peta situs Anda sendiri, pastikan bahwa pemrosesan data peta situs terjadi sekali dan panggilan berikutnya ke BuildSiteMap metode segera kembali, jika informasi peta situs telah dimuat. Saat Anda menerapkan BuildSiteMap metode ini, pastikan utas aman, karena beberapa permintaan halaman bersamaan dapat mengakibatkan beberapa panggilan secara tidak langsung untuk memuat informasi peta situs. Infrastruktur peta situs mendukung menampilkan informasi peta situs berdasarkan peran pengguna. Bergantung pada Roles properti yang didukung oleh objek individual SiteMapNode , struktur navigasi yang berbeda dapat ada untuk pengguna yang berbeda. Implementasi default anggota pengambilan simpul peta situs dari StaticSiteMapProvider kelas melakukan pemangkasan keamanan secara otomatis dengan memanggil IsAccessibleToUser metode .

Metode AddNode, Clear dan RemoveNode memanipulasi koleksi internal yang digunakan untuk melacak simpul peta situs dengan cara yang aman untuk utas.

Catatan Bagi Implementer

Ketika Anda mewarisi dari StaticSiteMapProvider kelas , Anda harus mengambil alih anggota berikut: BuildSiteMap().

Konstruktor

StaticSiteMapProvider()

Menginisialisasi instans baru kelas StaticSiteMapProvider.

Properti

CurrentNode

SiteMapNode Mendapatkan objek yang mewakili halaman yang saat ini diminta.

(Diperoleh dari SiteMapProvider)
Description

Mendapatkan deskripsi singkat dan ramah yang cocok untuk ditampilkan di alat administratif atau antarmuka pengguna (UI) lainnya.

(Diperoleh dari ProviderBase)
EnableLocalization

Mendapatkan atau menetapkan nilai Boolean yang menunjukkan apakah nilai SiteMapNode atribut yang dilokalkan dikembalikan.

(Diperoleh dari SiteMapProvider)
Name

Mendapatkan nama yang mudah diingat yang digunakan untuk merujuk ke penyedia selama konfigurasi.

(Diperoleh dari ProviderBase)
ParentProvider

Mendapatkan atau mengatur objek induk SiteMapProvider penyedia saat ini.

(Diperoleh dari SiteMapProvider)
ResourceKey

Mendapatkan atau mengatur kunci sumber daya yang digunakan untuk melokalisasi SiteMapNode atribut.

(Diperoleh dari SiteMapProvider)
RootNode

Mendapatkan objek akar SiteMapNode dari data peta situs yang diwakili penyedia saat ini.

(Diperoleh dari SiteMapProvider)
RootProvider

Mendapatkan objek akar SiteMapProvider dalam hierarki penyedia saat ini.

(Diperoleh dari SiteMapProvider)
SecurityTrimmingEnabled

Mendapatkan nilai Boolean yang menunjukkan apakah penyedia peta situs memfilter simpul peta situs berdasarkan peran pengguna.

(Diperoleh dari SiteMapProvider)

Metode

AddNode(SiteMapNode)

SiteMapNode Menambahkan objek ke kumpulan simpul yang dikelola oleh penyedia peta situs.

(Diperoleh dari SiteMapProvider)
AddNode(SiteMapNode, SiteMapNode)

SiteMapNode Menambahkan ke kumpulan yang dikelola oleh penyedia peta situs dan membuat hubungan induk/anak antara SiteMapNode objek.

BuildSiteMap()

Ketika ditimpa di kelas turunan, memuat informasi peta situs dari penyimpanan persisten dan membangunnya dalam memori.

Clear()

Menghapus semua elemen dalam kumpulan simpul peta situs anak dan induk yang dilacak StaticSiteMapProvider sebagai bagian dari statusnya.

Equals(Object)

Menentukan apakah objek yang ditentukan sama dengan objek saat ini.

(Diperoleh dari Object)
FindSiteMapNode(HttpContext)

SiteMapNode Mengambil objek yang mewakili halaman yang saat ini diminta menggunakan objek yang ditentukanHttpContext.

(Diperoleh dari SiteMapProvider)
FindSiteMapNode(String)

SiteMapNode Mengambil objek yang mewakili halaman pada URL yang ditentukan.

FindSiteMapNodeFromKey(String)

SiteMapNode Mengambil objek berdasarkan kunci tertentu.

GetChildNodes(SiteMapNode)

Mengambil simpul peta situs anak dari objek tertentu SiteMapNode .

GetCurrentNodeAndHintAncestorNodes(Int32)

Menyediakan metode pencarian yang dioptimalkan untuk penyedia peta situs saat mengambil simpul untuk halaman yang saat ini diminta dan mengambil simpul peta situs induk dan leluhur untuk halaman saat ini.

(Diperoleh dari SiteMapProvider)
GetCurrentNodeAndHintNeighborhoodNodes(Int32, Int32)

Menyediakan metode pencarian yang dioptimalkan untuk penyedia peta situs saat mengambil simpul untuk halaman yang saat ini diminta dan mengambil simpul peta situs di dekat simpul saat ini.

(Diperoleh dari SiteMapProvider)
GetHashCode()

Berfungsi sebagai fungsi hash default.

(Diperoleh dari Object)
GetParentNode(SiteMapNode)

Mengambil simpul peta situs induk dari objek tertentu SiteMapNode .

GetParentNodeRelativeToCurrentNodeAndHintDownFromParent(Int32, Int32)

Menyediakan metode pencarian yang dioptimalkan untuk penyedia peta situs saat mengambil simpul leluhur untuk halaman yang saat ini diminta dan mengambil simpul turunan untuk leluhur.

(Diperoleh dari SiteMapProvider)
GetParentNodeRelativeToNodeAndHintDownFromParent(SiteMapNode, Int32, Int32)

Menyediakan metode pencarian yang dioptimalkan untuk penyedia peta situs saat mengambil simpul leluhur untuk objek yang ditentukan SiteMapNode dan mengambil simpul anaknya.

(Diperoleh dari SiteMapProvider)
GetRootNodeCore()

Ketika ditimpa di kelas turunan, mengambil simpul akar dari semua simpul yang saat ini dikelola oleh penyedia saat ini.

(Diperoleh dari SiteMapProvider)
GetType()

Mendapatkan instans Type saat ini.

(Diperoleh dari Object)
HintAncestorNodes(SiteMapNode, Int32)

Menyediakan metode yang dapat diambil alih oleh penyedia peta situs untuk melakukan pengambilan yang dioptimalkan dari satu atau beberapa tingkat simpul induk dan leluhur, relatif terhadap objek yang ditentukan SiteMapNode .

(Diperoleh dari SiteMapProvider)
HintNeighborhoodNodes(SiteMapNode, Int32, Int32)

Menyediakan metode yang dapat diambil alih oleh penyedia peta situs untuk melakukan pengambilan simpul yang dioptimalkan yang ditemukan di kedekatan simpul yang ditentukan.

(Diperoleh dari SiteMapProvider)
Initialize(String, NameValueCollection)

Menginisialisasi SiteMapProvider implementasi, termasuk sumber daya apa pun yang diperlukan untuk memuat data peta situs dari penyimpanan persisten.

(Diperoleh dari SiteMapProvider)
IsAccessibleToUser(HttpContext, SiteMapNode)

Mengambil nilai Boolean yang menunjukkan apakah objek yang ditentukan SiteMapNode dapat dilihat oleh pengguna dalam konteks yang ditentukan.

(Diperoleh dari SiteMapProvider)
MemberwiseClone()

Membuat salinan dangkal dari yang saat ini Object.

(Diperoleh dari Object)
RemoveNode(SiteMapNode)

Menghapus objek yang ditentukan SiteMapNode dari semua kumpulan simpul peta situs yang dilacak oleh penyedia peta situs.

ResolveSiteMapNode(HttpContext)

Memunculkan kejadian SiteMapResolve.

(Diperoleh dari SiteMapProvider)
ToString()

Mengembalikan string yang mewakili objek saat ini.

(Diperoleh dari Object)

Acara

SiteMapResolve

Terjadi ketika CurrentNode properti dipanggil.

(Diperoleh dari SiteMapProvider)

Berlaku untuk

Lihat juga