Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected override CacheLevel ControlCacheLevel {
- get {
- return CacheLevel.ContentListener;
- }
- }
- protected override List<CacheDependencyKey> GetCacheDependencyObjects() {
- var cacheDependencyObjects = new List<CacheDependencyKey>();
- //Example listening to any PageNode event - e.g., a Navigation control
- cacheDependencyObjects.Add(new CacheDependencyKey() {
- Type = typeof(PageNode),
- Key = null
- });
- //Example listening to any NewsItem event - e.g., a News List type control
- cacheDependencyObjects.Add(new CacheDependencyKey() {
- Type = typeof(NewsItem),
- Key = null
- });
- //Example listening to a single Image Item - e.g., a banner control or similar...
- //NOTE: in a real example, you would use a public Guid as the key, and use that same Guid to get/display the image
- // : The .ToUpperInvariant() is important
- cacheDependencyObjects.Add(new CacheDependencyKey() {
- Type = typeof(Telerik.Sitefinity.Libraries.Model.Image),
- Key = "A72D2064-DB9A-6D2B-9FAD-FF0000A141DD".ToUpperInvariant()
- });
- //If this is a Control that has Comments available, you'll want to listen to all Comment events
- //That way, when a new one is added, the page this control lives on will automatically invalidate
- cacheDependencyObjects.Add(new CacheDependencyKey() {
- Type = typeof(Comment),
- Key = null
- });
- return cacheDependencyObjects;
- }
Advertisement
Add Comment
Please, Sign In to add comment