Share via


PartCacheInvalidate(Microsoft.SharePoint.WebPartPages.Storage) Method

The PartCacheInvalidate(Microsoft.SharePoint.WebParts.Storage) method of the WebPart class marks all contents of the specified storage type in the Web Part cache as outdated.

Parameters

storage   A Microsoft.SharePoint.WebPartPages.Storage that identifies the type of storage allocated in the Web Part cache. Possible values are Personal and Shared.

Remarks

Calling the PartCacheInvalidate(Microsoft.SharePoint.WebPartPages.Storage) method passing a Microsoft.SharePoint.WebPartPages.Storage value marks all content of the specified storage type in the Web Part cache as outdated. Call the PartCacheInvalidate() method to mark all of the contents of the Web Part cache as outdated. Call the PartCacheInvalidate(Microsoft.SharePoint.WebPartPages.Storage, String) method to mark only the specified cached value of the specified storage type in the Web Part cache as outdated.

Example

The following code example shows a Web Part that caches and displays the time when it is first rendered, and provides a button to refresh the Web Part cache with the current time.

Requirements

Platforms: Windows Server 2003

Security: Code Access Security