This documentation is archived and is not being maintained.

PersonalizationProvider::ResetState Method

When overridden in a derived class, deletes personalization state from the underlying data store based on the specified parameters.

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

public:
virtual int ResetState(
	PersonalizationScope scope, 
	array<String^>^ paths, 
	array<String^>^ usernames
) abstract

Parameters

scope
Type: System.Web.UI.WebControls.WebParts::PersonalizationScope
A PersonalizationScope of the personalization information to be reset. This value cannot be nullptr.
paths
Type: array<System::String>
The paths for personalization information to be deleted.
usernames
Type: array<System::String>
The user names for personalization information to be deleted.

Return Value

Type: System::Int32
The number of rows deleted.

This method is the abstract definition of an administrative method for deleting personalization data. Derived implementations should follow the logic described below.

No wildcard character searches are supported by this method. If the personalization provider exposes data from a transaction-aware data store, this method should perform its operations as a single atomic transaction.

Only the following combinations of parameters are allowed:

  • The scope parameter is set, and all other parameters are set to nullptr. This combination deletes all Web Parts personalization data associated with the personalization scope indicated by scope.

  • The scope parameter is set, and the paths parameter contains at least one value. This combination deletes all Web Parts personalization data for the specified path or paths in the personalization scope indicated by scope.

  • The scope parameter is set to User, the paths parameter is set and contains only one value, and the usernames parameter contains at least one value. This combination deletes all user personalization Web Parts data for the given path that is associated with the user or users contained in usernames.

  • The scope parameter is set to User, the paths parameter is set to nullptr, and the usernames parameter contains at least one value. This combination deletes all per-user personalization Web Parts data, across all paths, associated with the user or users contained in usernames.

Any other combination of parameter values is invalid and will throw an ArgumentException exception. Specifically, the following two combinations are not allowed:

  • The usernames parameter cannot be provided when scope is set to Shared.

  • The paths parameter cannot contain more than one entry when the usernames parameter is not nullptr.

Any paths and usernames parameter values contained within the respective arrays must meet the following validation rules. If any validation rules fail for any member of the parameter arrays, an ArgumentException exception is thrown. The validation rules are:

  • nullptr values are not allowed.

  • An empty string ("") is not allowed. Parameters should be trimmed prior to performing an empty string check.

  • The usernames parameter cannot contain commas (,).

  • The length of the paths parameter cannot be greater than 256 characters for a SQL database.

  • The length of the usernames parameter cannot be greater than 256 characters for a SQL database.

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