WebPartPersonalization.Load Method
Assembly: System.Web (in system.web.dll)
protected PersonalizationScope Load ()
protected function Load () : PersonalizationScope
Return Value
A PersonalizationScope instance for the parent WebPartManager.| Exception type | Condition |
|---|---|
| This method is called when personalization is not enabled (Enabled equals false). - or - The value of the Page property for the associated WebPartManager is a null reference (Nothing in Visual Basic). - or - The value of the Request property on the WebPartManager control's associated Page instance is a null reference (Nothing in Visual Basic). | |
| A provider was explicitly set in either the page markup or the ProviderName property and the provider could not be found. - or - The object containing the personalization state data is a null reference (Nothing in Visual Basic). | |
| A problem occurred while loading and deserializing data. - or - An error occurred in the definition of a personalization provider in the configuration file. | |
| The underlying personalization providers failed to initialize because a default provider could not be found or because a failure occurred while attempting to initialize a personalization provider. |
This is the main entry point for initializing personalization information on behalf of the parent WebPartManager control. This method is called during the parent WebPartManager control's OnInit method. Normally, if personalization has been disabled on the parent WebPartManager control, this method will never be called.
During the course of this method, the following initializations occur:
-
A reference to either the default personalization provider, or the custom provider indicated in the WebPartManager page markup or the ProviderName property, is obtained.
-
The provider is called to determine the user capabilities (DetermineUserCapabilities) for the currently executing user.
-
The personalization state for the current page/user/scope combination is loaded from the underlying data store by the provider (LoadPersonalizationState) and stored within the WebPartPersonalization instance.
-
The personalization scope for the current page/user/scope is determined by the provider (DetermineInitialScope). Note that the result of this determination might be different than the value of the InitialScope property.
The scope value returned from this method is used as the value for the Scope property.
Note |
|---|
| An InvalidOperationException exception due to personalization not being enabled will occur only if the Load method is called directly. In the ASP.NET implementation, an internal helper method is actually called to perform the load, and this helper method silently returns if personalization has not been enabled for the page. |
Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.
Reference
WebPartPersonalization ClassWebPartPersonalization Members
System.Web.UI.WebControls.WebParts Namespace
WebPartPersonalization Class
Other Resources
ASP.NET Web Parts PagesWeb Parts Personalization Overview
Walkthrough: Implementing Web Parts Personalization with a User Control
Web Parts Personalization
Note