Export (0) Print
Expand All

WebPartsPersonalization.Providers Property

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

Namespace:  System.Web.Configuration
Assembly:  System.Web (in System.Web.dll)

[ConfigurationPropertyAttribute("providers")]
public ProviderSettingsCollection Providers { get; }

Property Value

Type: System.Configuration.ProviderSettingsCollection
A ProviderSettingsCollection collection that contains the Web Parts personalization providers for the current Web application.

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

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);
}

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0
Show:
© 2015 Microsoft