Uredi

Deli z drugimi prek


PersonalizationProvider.LoadPersonalizationState Method

Definition

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

public:
 virtual System::Web::UI::WebControls::WebParts::PersonalizationState ^ LoadPersonalizationState(System::Web::UI::WebControls::WebParts::WebPartManager ^ webPartManager, bool ignoreCurrentUser);
public virtual System.Web.UI.WebControls.WebParts.PersonalizationState LoadPersonalizationState (System.Web.UI.WebControls.WebParts.WebPartManager webPartManager, bool ignoreCurrentUser);
abstract member LoadPersonalizationState : System.Web.UI.WebControls.WebParts.WebPartManager * bool -> System.Web.UI.WebControls.WebParts.PersonalizationState
override this.LoadPersonalizationState : System.Web.UI.WebControls.WebParts.WebPartManager * bool -> System.Web.UI.WebControls.WebParts.PersonalizationState
Public Overridable Function LoadPersonalizationState (webPartManager As WebPartManager, ignoreCurrentUser As Boolean) As PersonalizationState

Parameters

webPartManager
WebPartManager

The WebPartManager managing the personalization data.

ignoreCurrentUser
Boolean

A Boolean indicating whether the user name should be passed to the personalization provider.

Returns

A PersonalizationState containing personalization data.

Exceptions

The webPartManager is null.

The page associated with webPartManager is null.

-or-

The request associated with the page is null.

Remarks

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.

Applies to