WebPartPersonalization.ResetPersonalizationState Method

Note: This method is new in the .NET Framework version 2.0.

Resets personalization data for the current page, scope, and user in the underlying data store.

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

public:
virtual void ResetPersonalizationState ()
public void ResetPersonalizationState ()
public function ResetPersonalizationState ()

Exception typeCondition

InvalidOperationException

An attempt was made to reset personalization data when the current user is not authorized to modify personalization state.

- or -

The Page instance 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).

InvalidOperationException

The WebPartPersonalization instance cannot reference a valid personalization provider.

This method resets personalization data for the current page, scope, and user in the underlying data store. As a side effect of the reset, the currently executing page is re-executed by a Transfer call. Note that this transfer re-executes the current page as a GET request regardless of how the page was originally requested.

This method can be called at any time. Internally, this method calls the ResetPersonalizationState method on the provider. After data is successfully reset, the ShouldResetPersonalizationState property is set to true. This property is used elsewhere by the WebPartPersonalization instance to bypass extracting personalization data from control properties and saving it if data has already been reset.

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.

.NET Framework

Supported in: 2.0

Community Additions

ADD
Show: