Gets a value that indicates whether the custom data that a control manages has changed.
Assembly: System.Web (in System.Web.dll)
When data managed by a control has changed, the control is considered "dirty." A control should return true if the custom data that it manages through the IPersonalizable interface has changed. If a control returns true from this property, the control's Save interface method implementation is called during property value extraction.
This property is checked automatically by the personalization infrastructure during the latter phases of processing a POST request. However, for GET requests, the value returned from the property is not checked. Some other event has to have caused the control to be considered "dirty" for any control state--not just data managed by IPersonalizable--to be saved. If a control can mark itself as "dirty" during a GET request, or if the personalization infrastructure under some very specific boundary conditions considers a control "dirty" during a GET request, then Save will always be called.
A control can reference its associated WebPartManager control and check the Scope property to determine the current scope. The "dirty" state of a control's custom data should be appropriate for the current scope.
The following code example demonstrates use of the property. The first part of the example is the Web page that hosts a WebPart control.
The second part of the example is the code for the custom WebPart control called UrlListWebPart. This file should be placed in the App_Code directory to run the example. Note that the source code implements the property.
Load the page in a browser. Type in a name to represent a URL, then add an actual URL beginning with http://, and click the Add button to add the URL.
Windows 8.1, Windows Server 2012 R2, 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.