This documentation is archived and is not being maintained.

PersonalizationProvider::LoadPersonalizationState Method

Loads the raw data from the underlying data store and converts that data into a PersonalizationState object.

Namespace:  System.Web.UI.WebControls.WebParts
Assembly:  System.Web (in System.Web.dll)

public:
virtual PersonalizationState^ LoadPersonalizationState(
	WebPartManager^ webPartManager, 
	bool ignoreCurrentUser
)

Parameters

webPartManager
Type: System.Web.UI.WebControls.WebParts::WebPartManager
The WebPartManager managing the personalization data.
ignoreCurrentUser
Type: System::Boolean
A Boolean indicating whether the user name should be passed to the personalization provider.

Return Value

Type: System.Web.UI.WebControls.WebParts::PersonalizationState
A PersonalizationState containing personalization data.

ExceptionCondition
ArgumentNullException

The webPartManager is nullptr.

ArgumentException

The page associated with webPartManager is nullptr.

- or -

The request associated with the page is nullptr.

This method is the main entry point used by the WebPartPersonalization class to load personalization data. The default implementation loads the raw data from the underlying data store (functionality is implemented in derived providers) and then converts the raw data into a PersonalizationState instance.

If the ignoreCurrentUser parameter is true, no user name is passed to the LoadPersonalizationBlobs method. A personalization provider can choose to interpret this as meaning that only personalization state with a Shared scope should be retrieved from the underlying data store.

When the Load method is executing, it calls the LoadPersonalizationState method, and there are three types of deserialization errors that can occur as the state is being loaded. When these specific errors occur, no exception is thrown, and the error events are logged instead by the Health Monitoring feature (for information on health monitoring and accessing the logs created by it, see ASP.NET Health Monitoring Overview). The following three scenarios cause deserialization error events to be written to the log:

  • A failed attempt to deserialize a property type that uses a string TypeConverter.

  • A failed attempt to deserialize a property type that uses binary serialization.

  • A failed attempt to deserialize a property type because an instance of the type cannot be created.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

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.
Show: