Export (0) Print
Expand All

PersonalizationAdministration.ResetState Method

Resets personalization data in the underlying data store, based on the items contained in the collection.

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

public static int ResetState(
	PersonalizationStateInfoCollection data
)

Parameters

data
Type: System.Web.UI.WebControls.WebParts.PersonalizationStateInfoCollection
A collection of PersonalizationStateInfo objects indicating what data should be reset.

Return Value

Type: System.Int32
The number of rows that were reset.

ExceptionCondition
ArgumentNullException

data is null.

ArgumentException

data is an empty collection.

- or -

An element of the collection is null.

- or -

The path value of a UserPersonalizationStateInfo instance in the collection is null or an empty string ("").

- or -

The user value of a UserPersonalizationStateInfo instance in the collection is null, an empty string, or contains commas.

- or -

The provider for a personalization provider defined in configuration is not of the correct type.

- or -

The length of the string of any parameter is greater than 256 characters.

ConfigurationErrorsException

A configuration exception occurred while attempting to create and initialize an instance of one of the configured personalization providers.

- or -

The default personalization provider defined in configuration could not be found.

HttpException

The default provider indicated that the number of deleted rows was a negative number.

This method resets personalization data in the underlying data store, based on the PersonalizationStateInfo objects contained in the collection. You can use this method to selectively delete a mixture of shared and per-user data based on the collection's contents. SharedPersonalizationStateInfo objects indicate that shared data for a page will be reset; UserPersonalizationStateInfo objects indicate that per-user data for a specific page will be reset.

NoteNote

This method does not guarantee that all resets occur within a single transaction because the collection points to random sets of personalization data.

It is not an error for the collection to contain objects that reference nonexistent data.

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

Community Additions

ADD
Show:
© 2014 Microsoft