Custom control caching question
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngescalate' list.


Douglas.Rowe@USOncology.com
I have asked this question in aspngcache with no results, so I am
resubmitting the question here.

I have built a custom control that I have compiled into a dll and placed in
the bin folder and registered on an .aspx page. All works fine. The
control displays one random record from a database based on certain internal
criteria, meaning I pass no information to the control. I want to cache the
output of the control and have it expire at midnight, every night, so that a
new record is displayed every day. How do I set caching up for a compiled,
custom control in this scenario?

Thanks

Reply to this message...
 
    
Michael
Use the Context.Cache.Add method
See

ms-help://MS.VSCC/MS.MSDNVS/cpref/html/frlrfsystemwebcachingcacheclassaddtop
ic.htm

Cache.Add Method
[C#]
public object Add(
string key,
object value,
CacheDependency dependencies,
DateTime absoluteExpiration,
TimeSpan slidingExpiration,
CacheItemPriority priority,
CacheItemRemovedCallback onRemoveCallback
);
Parameters
key
The cache key used to reference the item.
value
The item to be added to the cache.
dependencies
The file or cache key dependencies for the item. When any dependency
changes, the object becomes invalid and is removed from the cache. If there
are no dependencies, this paramter contains a null reference (Nothing in
Visual Basic).
absoluteExpiration
The time at which the added object expires and is removed from the cache.
.........................................................................

-----Original Message-----
From: Click here to reveal e-mail address [mailto:Click here to reveal e-mail address]
Sent: Saturday, 4 May 2002 4:14 AM
To: aspngescalate
Subject: [aspngescalate] Custom control caching question

I have asked this question in aspngcache with no results, so I am
resubmitting the question here.

I have built a custom control that I have compiled into a dll and placed in
the bin folder and registered on an .aspx page. All works fine. The
control displays one random record from a database based on certain internal
criteria, meaning I pass no information to the control. I want to cache the
output of the control and have it expire at midnight, every night, so that a
new record is displayed every day. How do I set caching up for a compiled,
custom control in this scenario?

Thanks

| [aspngescalate] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngescalate.asp = JOIN/QUIT

Reply to this message...
 
 
System.DateTime
System.Runtime.Remoting.Contexts.Context
System.TimeSpan
System.Web.Caching.Cache
System.Web.Caching.CacheDependency
System.Web.Caching.CacheItemPriority
System.Web.Caching.CacheItemRemovedCallback




Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
 
 Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us - Terms of Use - Privacy Policy - www.dotnet247.com