SiteMapProviderCollection.AddArray(SiteMapProvider[]) Method


Adds an array of SiteMapProvider objects into the provider collection using the Name properties as keys.

 void AddArray(cli::array <System::Web::SiteMapProvider ^> ^ providerArray);
public void AddArray (System.Web.SiteMapProvider[] providerArray);
member this.AddArray : System.Web.SiteMapProvider[] -> unit
Public Sub AddArray (providerArray As SiteMapProvider())



The array of SiteMapProvider objects to add.


A SiteMapProvider with the same name already exists in the SiteMapProviderCollection.

providerArray is null.


The SiteMapProviderCollection that is returned by the Providers property is read-only. For this reason, you cannot use the Add and AddArray methods to add additional providers programmatically at run time. Therefore, the Add and AddArray methods are only used in scenarios where you manually create site map provider objects and manage them with an instance of the SiteMapProviderCollection class.

Because the SiteMap class is static, any SiteMapProvider contained in its Providers collection remains for the lifetime of the Web application.

Applies to

See also