This documentation is archived and is not being maintained.

WebPartPersonalization::Save Method

Saves personalization data for the current page, scope, and user to the underlying data store.

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

protected:
virtual void Save()

ExceptionCondition
InvalidOperationException

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

- or -

The value of the Request property on the WebPartManager control's associated Page instance is nullptr.

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.

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0
Show: