System.Web.SiteMapProvider.Initialize Method

Initializes the System.Web.SiteMapProvider implementation, including any resources that are needed to load site map data from persistent storage.

Syntax

public override void Initialize (string name, System.Collections.Specialized.NameValueCollection attributes)

Parameters

name
The System.Configuration.Provider.ProviderBase.Name of the provider to initialize.
attributes
A System.Collections.Specialized.NameValueCollection that can contain additional attributes to help initialize the provider. These attributes are read from the site map provider configuration in the Web.config file.

Remarks

The SiteMapProvider.Initialize(string, System.Collections.Specialized.NameValueCollection) method does not actually build a site map, it only prepares the state of the System.Web.SiteMapProvider object to do so. The default implementation initializes the SiteMapProvider.SecurityTrimmingEnabled property for the site map provider from the site navigation configuration.

Classes that derive from the System.Web.SiteMapProvider can override the SiteMapProvider.Initialize(string, System.Collections.Specialized.NameValueCollection) method to initialize any state and resources that are required to load site map data from persistent storage. For example, if your derived class is using files to store site map data, any file initialization can be performed in the SiteMapProvider.Initialize(string, System.Collections.Specialized.NameValueCollection) method. If the derived class uses some other type of data store, such as a relational database, initializing a database connection might be performed.

Additional attributes, such as file names or connection strings, are read by the ASP.NET configuration system and passed to the SiteMapProvider.Initialize(string, System.Collections.Specialized.NameValueCollection) method with its System.Collections.Specialized.NameValueCollection parameter.

Requirements

Namespace: System.Web
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0