Cache an object

P

Prashanth

Hi,
I want to cache an object whose scope in only within the page. The
cache should expire once the user leaves the page. How can I do it?
Regards,
Prashanth
 
S

sloan

K

Karl Seguin [MVP]

Sloan:
You are missing the viewstate. I only mention it because it might be what's
wanted in this case. "scope of the page" isn't particularly clear though, so
it's hard to tell. Context is ideal for dealing with the start of page
processing (say init) to the end (say prerender). If you want the data to
survive a postback, you'll need to do something more persistant. ViewState
might work, but it's rendered on the client so it needs to (1) be
serializable and (2) be small.

Karl
 
S

sloan

Ooooops!

You're right Karl... I forgot about that one!

That's why I should answer posts that early in the morning.




"Karl Seguin [MVP]" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME
net> wrote in message news:[email protected]...
 
P

Prashanth

Karl,
I want the data to survive a post back but cannot use viewstate since
the objects is not serializable.
 
K

Karl Seguin [MVP]

Well, either make it serializable(which isn't always possible) or you'll
need to persist it in memory. You are likely stuck using sessions.

Karl
 

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,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top