Sets a flag indicating that personalization data has changed for the current WebPart control instance.
Assembly: System.Web (in System.Web.dll)
The SetPersonalizationDirty method sets a flag indicating that control state data has been changed (personalized) on a WebPart control, and that the WebPartManager control therefore needs to persist the personalization data to long term storage.
Normally the WebPartManager persists personalization changes on WebPart controls without a need for developers to call the SetPersonalizationDirty method. But there are two cases in which developers do need to call this method. The first case is when control state data is changed during an HTTP GET request to a page. By default, changes to control state data during a GET request are not persisted (for security purposes). But the SetPersonalizationDirty method provides a way to persist legitimate personalization changes to WebPart controls in this case.
The second case for calling the SetPersonalizationDirty method occurs during an HTTP POST request to a page. If a WebPart control has complex personalizable properties (such as a property that contains an ArrayList object), and control state data in those properties is personalized during a POST request, developers must call the SetPersonalizationDirty method to ensure that the changes are persisted.
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.