Edit

Bagikan melalui


SiteMapProviderCollection.AddArray(SiteMapProvider[]) Method

Definition

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

public:
 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())

Parameters

providerArray
SiteMapProvider[]

The array of SiteMapProvider objects to add.

Exceptions

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

providerArray is null.

Remarks

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