SiteMapProviderCollection::AddArray Method
Adds an array of SiteMapProvider objects into the provider collection using the Name properties as keys.
Assembly: System.Web (in System.Web.dll)
Parameters
- providerArray
- Type: array<System.Web::SiteMapProvider>
The array of SiteMapProvider objects to add.
| Exception | Condition |
|---|---|
| ArgumentException | A SiteMapProvider with the same name already exists in the SiteMapProviderCollection. |
| ArgumentNullException | providerArray is nullptr. |
| NotSupportedException | The SiteMapProviderCollection is read-only. |
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.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.