WebPartPersonalization.Save 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.
Saves personalization data for the current page, scope, and user to the underlying data store.
protected:
virtual void Save();
protected virtual void Save ();
abstract member Save : unit -> unit
override this.Save : unit -> unit
Protected Overridable Sub Save ()
Exceptions
The current user does not have the capability called ModifyStateUserCapability.
-or-
The WebPartPersonalization instance cannot reference a valid personalization provider.
-or-
No personalization provider is currently associated with the WebPartPersonalization instance. This can occur if this method is called prior to calling Load() (the personalization provider reference is obtained during the call to Load().
-or-
No personalization state has been loaded.
-or-
The Page instance for the associated WebPartManager is null
.
-or-
The value of the Request property on the WebPartManager control's associated Page instance is null
.
Remarks
This method is called during the WebPartManager control's SaveStateComplete event. Internally, the method calls the SavePersonalizationState method on the provider.
Attempting to save personalization data when the currently executing user does not have the capability called ModifyStateUserCapability (within the current WebPartUserCapability instance) results in an InvalidOperationException exception. Note that this would only be true if the WebPartManager control called the protected Save method directly. In the ASP.NET implementation, an internal helper method is actually called to perform the save, and this helper method silently returns if the currently executing user does not have rights to modify data.