Cache a User Control?

D

DDK

I am wondering how to go about caching a User Control for a set period of 24
hours starting at a certain time like 3am and lasting til 3am the following
day. I know you can put the Output cache directive in the User Control
but I need the cache to be permanent, and I don't think you can make it
permanent with the Output cache. Or can you? The User control has a
datalist on it using a Sql Server database. So basically I just need to
find out how to go about caching the User Control or the database query for
24 hours.

Any info on how you might go about caching the User Control or query would
be much appreciated.

If you have any links on the subject that might be helpful, that would be
great too!

Thanks in advance,
D.
 
N

Natty Gur

Hi,

The cache object can get as parameter a callback function that will be
call when the added object expired. You can use this callback function
to refill the data in the cache.

Look at [1] for farther details and sample code.

[1] - http://www.developersdex.com/gurus/code/653.asp

Natty Gur, CTO
Dao2Com Ltd.
28th Baruch Hirsch st. Bnei-Brak
Israel , 51114

Phone Numbers:
Office: +972-(0)3-5786668
Fax: +972-(0)3-5703475
Mobile: +972-(0)58-888377

Know the overall picture
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,772
Messages
2,569,593
Members
45,111
Latest member
VetaMcRae
Top