PartCacheInvalidate(Microsoft.SharePoint.WebPartPages.Storage, String) Method

The PartCacheInvalidate(Microsoft.SharePoint.WebPartPages.Storage, String) method of the WebPart class marks the specified cache entries 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 to mark as outdated. Possible values are Personal and Shared.

key   A value that identifies the cache entry of the specified storage type in the Web Part cache.

Remarks

Calling the PartCacheInvalidate(Microsoft.SharePoint.WebPartPages.Storage, String) method passing a Microsoft.SharePoint.WebPartPages.Storage value and a key as arguments marks only the specified cached value of the specified storage type in the Web Part cache as outdated. Call the PartCacheInvalidate() method to mark all content of the Web Part cache as outdated. Call the PartCacheInvalidate(Microsoft.SharePoint.WebPartPages.Storage) method to mark all content 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