Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Keeping a list in memory

Posted on 2013-06-17
3
159 Views
Last Modified: 2013-06-19
May sound like a dumb question but here goes.

I instantiate a LIST from my homepage, the list is in a global class file, and returns all the information about the person logging in. the person, could have one or more accounts associated with the site, and therefore i need to code against a default flag to display their default account informaiton. However, i then also need to build their other account information and display this for them.

The additional account(s) are listed in a drop down box. when the drop down box fires off, instead of calling out to the class again, and retrieving all the necessary information, as i've already done this once, how can i store the object, so that it can be used?

I've looked at Session Variables, but this gets a bit messy (I have 35 fields being returned in my list), plus, the Session variables only get set the first time around, not on DDL changed.

therefore, I need a way of having quick access to the object. - what's the best approach?
0
Comment
Question by:Wayne Atherton
3 Comments
 
LVL 13

Expert Comment

by:jonnidip
ID: 39253261
You may try to approach it by using System.Web.Caching.Cache class.

Regards
0
 
LVL 14

Accepted Solution

by:
Daniel Junges earned 500 total points
ID: 39253268
you can store you list on the Session or on the Application object,

Example:

Session["myList"] = myObject;
or
Application["myList"] = myObject;
0
 
LVL 1

Author Closing Comment

by:Wayne Atherton
ID: 39258859
thanks
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Alert on Server memory 2 37
Need to learn more about SecurityProtocolType.Tls12 3 53
Call Controller Action Method from ASPX 2 22
JSON  parse help 7 40
It seems a simple enough task, yet I see repeated questions asking how to do it: how to pass data between two forms. In this article, I will show you the different mechanisms available for you to do just that. This article is directed towards the .N…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question