problems with public properties

P

pietaster

I really dont know what I should do. I am asking for best practices.

currently I create my properties by doing this.

Context.Items.Add("Info", new Info(Request.QueryString["acct"],
Request.QueryString["option"]));

Info is a class that I call that places all data retrieved from a db
into public properties.

I get the data by:

Info my = (Info) HttpContext.Current.Items["Info"];

but as you all know this does not work because Context is for current
request.

I have multiple tabs and I bring all my data in at the beginning and
then by using public properties I populate the different tabs.

What can I do that will ensure I am able to retrieve my public
properties for each tab. I'm sure I need to use session but I am not
sure the best way.


Please help,
Thanks pietaster
 
H

Hermit Dave

Well if you have same tabs for all users then its a waste using Session to
store the data for you to retrieve from.
Application used the common place for global data dump in ASP days.... but
now you have a more flexible Cache object. If you want to store
anything...,. cache is the place...
You can still use Application but if it starts running out of memory... it
causes the applicaiton to restart... on the other hand cache is smarter.. it
just starts chucking things out based on it priority settings...

hope this helps....
 
C

Charlie Nilsson [MSFT]

Check out the Cache object -- it is the new replacement for the older
Application collection in ASP.

Cache supports many methods of storing data smartly (like cache timeouts,
refreshes, etc..) and shares data across sessions.
 

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

Forum statistics

Threads
473,743
Messages
2,569,477
Members
44,898
Latest member
BlairH7607

Latest Threads

Top