PersonalizationProvider.ResetState Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
When overridden in a derived class, deletes personalization state from the underlying data store based on the specified parameters.
public:
abstract int ResetState(System::Web::UI::WebControls::WebParts::PersonalizationScope scope, cli::array <System::String ^> ^ paths, cli::array <System::String ^> ^ usernames);
public abstract int ResetState (System.Web.UI.WebControls.WebParts.PersonalizationScope scope, string[] paths, string[] usernames);
abstract member ResetState : System.Web.UI.WebControls.WebParts.PersonalizationScope * string[] * string[] -> int
Public MustOverride Function ResetState (scope As PersonalizationScope, paths As String(), usernames As String()) As Integer
Parameters
- scope
- PersonalizationScope
A PersonalizationScope of the personalization information to be reset. This value cannot be null
.
- paths
- String[]
The paths for personalization information to be deleted.
- usernames
- String[]
The user names for personalization information to be deleted.
Returns
The number of rows deleted.
Remarks
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 tonull
. This combination deletes all Web Parts personalization data associated with the personalization scope indicated byscope
.The
scope
parameter is set, and thepaths
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 byscope
.The
scope
parameter is set to User, thepaths
parameter is set and contains only one value, and theusernames
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 inusernames
.The
scope
parameter is set to User, thepaths
parameter is set tonull
, and theusernames
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 inusernames
.
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 whenscope
is set to Shared.The
paths
parameter cannot contain more than one entry when theusernames
parameter is notnull
.
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:
null
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.