SiteMapProviderCollection.Item[String] Property

Definition

Gets a SiteMapProvider object with a specific name from the provider collection.Gets a SiteMapProvider object with a specific name from the provider collection.

public:
 property System::Web::SiteMapProvider ^ default[System::String ^] { System::Web::SiteMapProvider ^ get(System::String ^ name); };
public System.Web.SiteMapProvider this[string name] { get; }
member this.Item(string) : System.Web.SiteMapProvider
Default Public ReadOnly Property Item(name As String) As SiteMapProvider

Parameters

name
String

The name of the SiteMapProvider to find.The name of the SiteMapProvider to find.

Property Value

SiteMapProvider

Объект SiteMapProvider, представляющий элемент SiteMapProviderCollection.A SiteMapProvider that represents a SiteMapProviderCollection element.

Examples

В следующем примере кода показано, как использовать свойство Item[] для получения объекта по умолчанию SiteMapProvider ASP.NET из объекта SiteMapProviderCollection, который возвращается при обращении к коллекции Providers.The following code example demonstrates how to use the Item[] property to retrieve the default ASP.NET SiteMapProvider object from the SiteMapProviderCollection object that is returned when the Providers collection is accessed.

// Retrive the SiteMapProviderCollection that contains 
// the providers currently in use.
SiteMapProviderCollection providers = SiteMap.Providers;

// Use the Indexer to retrieve the default provider for ASP.NET.
SiteMapProvider defaultProvider = providers["AspNetXmlSiteMapProvider"];

' Retrive the SiteMapProviderCollection that contains 
' the providers currently in use.
Dim providers As SiteMapProviderCollection 
providers = SiteMap.Providers

' Use the Indexer to retrieve the default provider for ASP.NET.
Dim defaultProvider As SiteMapProvider 
defaultProvider = providers("AspNetXmlSiteMapProvider")

Remarks

Индексатор можно использовать для прохода по содержимому объекта SiteMapProviderCollection.You can use the indexer to iterate over the contents of a SiteMapProviderCollection object.

Applies to

See also