WebPartsPersonalization.Providers Property

Definition

Gets a ProviderSettingsCollection collection that contains the Web Parts personalization providers for the current Web application.

[System.Configuration.ConfigurationProperty("providers")]
public System.Configuration.ProviderSettingsCollection Providers { get; }

Property Value

A ProviderSettingsCollection collection that contains the Web Parts personalization providers for the current Web application.

Attributes

Examples

The following code example shows how to use the Providers property. This code example is part of a larger example provided for the WebPartsSection class.

// Add a provider.
webPartsSection.Personalization.Providers.Add(
    new ProviderSettings("CustomProvider", 
    "MyCustomProviders.Provider"));

// List current providers.
for (int pi = 0; 
    pi < webPartsSection.Personalization.Providers.Count; pi++)
{
    Console.WriteLine("  #{0} Name={1} Type={2}", pi,
        webPartsSection.Personalization.Providers[pi].Name,
        webPartsSection.Personalization.Providers[pi].Type);
}

Remarks

Web Parts personalization providers can only be defined at the Web-application level (in a Web.config file).

Applies to

产品 版本
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

See also