SiteMapProviderCollection.Item Property (String)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

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

Namespace:   System.Web
Assembly:  System.Web (in System.Web.dll)

public SiteMapProvider this[
	string name
] { get; }

Parameters

name
Type: System.String

The name of the SiteMapProvider to find.

Property Value

Type: System.Web.SiteMapProvider

A SiteMapProvider that represents a SiteMapProviderCollection element.

You can use the indexer to iterate over the contents of a SiteMapProviderCollection object.

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"];

.NET Framework
Available since 2.0
Return to top
Show: