Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 434163
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T20:14:46+00:00 2026-05-12T20:14:46+00:00

I have an ASP.NET web application and I want to be able to take

  • 0

I have an ASP.NET web application and I want to be able to take items from a master list and store them temporarliy into one of four other lists. The ‘other’ lists need to survive post backs so that more items can be added to them. What direction would you suggest going with?

I have thought of using a generic list stored in memory, temporarliy storing the items into the database and calling them back on PostBack, or storing them into the viewstate, but I have a feeling that there is some solution that I’m missing that might be easier or better.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T20:14:47+00:00Added an answer on May 12, 2026 at 8:14 pm

    Josh laid out the states pretty well. My recommendation for a smaller list like he said would be using Session state. Using the DB would be a little messy because you have to maintain those temp tables and worry about multi-session access to the tables. Likewise, cache have the same problem. Viewstate gives you this with extra client traffic and insecure data. So if you’re talking less than a few thousand instances on a low traffic server, then session is likely fine.

    To make session easier to work with (and you can do this with caching and application state as well) is setup a container object that manages the lists.

    //To use it in your page, you can easily access it via: 
    
    ListManagerContext.Current.MasterList.Add(4);
    
    
    [Serializable]
    public class ListManagerContext
    {
        public List<int> MasterList { get; set; }
        public List<int> SubList1 { get; set; }
        public List<int> SubList2 { get; set; }
        public List<int> SubList3 { get; set; }
    
    
        /// <summary>
        /// Key used for the list manager context session variable.
        /// </summary>
        public const string ListManagerContextKey = "ListManagerContext";
    
        /// <summary>
        /// Gets the current ListManagerContext for this session. 
        /// If none exists, it returns a brand new one. 
        /// </summary>
        [XmlIgnore]
        public static ListManagerContext Current
        {
            get
            {
                HttpContext context = HttpContext.Current;
    
                if (context != null && context.Session != null)
                {
                    ListManagerContext data = null;
                    if (context.Session[ListManagerContextKey] == null)
                    {
                        data = new ListManagerContext();
                        context.Session[ListManagerContextKey] = data;
                    }
                    else
                        data = context.Session[ListManagerContextKey] 
                                      as ListManagerContext;
    
                    return data;
                }
                throw new ApplicationException("
                      No session available for list manager context.");
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created blank Asp.Net-MVC 3 web application and want to write my own
I have a Asp.net MVC web application, containing mostly text. I want to put
My situation is this: I have an ASP.NET web application that I want to
I have enabled form authentication in my ASP.NET MVC web application. I want to
I have a asp.net web application that uses C#. It logs in on a
I have an ASP.NET web application the entire site is browsed over HTTPS using
I have an asp.net web application written in C# using a SQL Server 2008
We have an ASP.NET web application hosted by a web farm of many instances
I have a ASP.NET web application which has more than 100 pages. Each page
I have a asp.net web application and I'm using cache (HttpRuntime.Cache) to save some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.