PersonalizationProvider.LoadPersonalizationState Method (WebPartManager, Boolean)

 

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.

Exception Condition
ArgumentNullException

The webPartManager is null.

ArgumentException

The page associated with webPartManager is null.

- or -

The request associated with the page is null.

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
Available since 2.0
Return to top
Show: