Solved

Keeping a list in memory

Posted on 2013-06-17
3
154 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

The object model of .Net can be overwhelming at times – so overwhelming that quite trivial tasks often take hours of research. In this case, the task at hand was to populate the datagrid from SQL Server database in Visual Studio 2008 Windows applica…
This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

705 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now