Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>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. </p> <p>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. </p> <pre><code>//To use it in your page, you can easily access it via: ListManagerContext.Current.MasterList.Add(4); [Serializable] public class ListManagerContext { public List&lt;int&gt; MasterList { get; set; } public List&lt;int&gt; SubList1 { get; set; } public List&lt;int&gt; SubList2 { get; set; } public List&lt;int&gt; SubList3 { get; set; } /// &lt;summary&gt; /// Key used for the list manager context session variable. /// &lt;/summary&gt; public const string ListManagerContextKey = "ListManagerContext"; /// &lt;summary&gt; /// Gets the current ListManagerContext for this session. /// If none exists, it returns a brand new one. /// &lt;/summary&gt; [XmlIgnore] public static ListManagerContext Current { get { HttpContext context = HttpContext.Current; if (context != null &amp;&amp; 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."); } } } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload