XmlDataSource.CacheKeyDependency 屬性

定義

取得或設定使用者定義的索引鍵相依性,這個索引鍵相依性連結至資料來源控制項所建立的所有資料快取物件。Gets or sets a user-defined key dependency that is linked to all data cache objects created by the data source control. 索引鍵過期時,所有快取物件都會明確過期。All cache objects explicitly expire when the key expires.

public:
 virtual property System::String ^ CacheKeyDependency { System::String ^ get(); void set(System::String ^ value); };
public virtual string CacheKeyDependency { get; set; }
member this.CacheKeyDependency : string with get, set
Public Overridable Property CacheKeyDependency As String

屬性值

String

索引鍵,識別 XmlDataSource 控制項建立的所有快取物件。A key that identifies all cache objects created by the XmlDataSource control.

備註

XmlDataSource控制項支援資料快取。The XmlDataSource control supports data caching. 快取資料時,會從快取中取出 XmlDataSource 資料,而不是從基礎資料檔案。While data is cached, the XmlDataSource retrieves data from the cache rather than from the underlying data file. 當快取過期時,它會從基礎檔案取出資料,並重新快取資料。When the cache expires, it retrieves data from the underlying file and re-caches the data.

您可以設定 CacheKeyDependency 屬性,以建立控制項和索引鍵所建立之所有快取專案之間的相依性 XmlDataSourceYou can set the CacheKeyDependency property to create a dependency between all cache entries created by the XmlDataSource control and the key. 您可以藉由將金鑰過期,以程式設計方式使所有快取專案失效。You can programmatically invalidate all the cache entries at any time by expiring the key.

由於用來建立的屬性 CacheKeyDependency ,當多個 XmlDataSource 控制項從相同的 XML 檔和轉換檔案載入相同的資料,並設定相同和設定時,可能會在這些情況下使用相同的快取 CacheDuration CacheExpirationPolicyBecause of the properties used to create the CacheKeyDependency, it is possible that multiple XmlDataSource controls can use the same cache in scenarios where they load the same data from the same XML file and transform file and have the same CacheDuration and CacheExpirationPolicy set.

適用於

另請參閱