title: Accessing properties of object stored in session
body: <p>I must be misunderstanding something about session.  I'm trying to store some information, so let me give the details.</p>
  
  <p>Here's my "container" class that holds a list of business objects.  This container is stored in session.</p>
  
  <pre><code>public class MySessionContainer {
      private IList&lt;SomeBusinessObjectType&gt; _BusinessObjectList = new List&lt;SomeBusinessObjectType&gt;();
      public IList&lt;SomeBusinessObjectType&gt; BusinessObjectList {
          get { return _BusinessObjectList; }
          set { _BusinessObjectList = value; }
      }
  }
  </code></pre>
  
  <p>I have a set of pages that form a wizard/multi-step process, and they all need to access the list of business objects in the container, which is in session. </p>
  
  <p>The first page adds business objects to the list in session, so this sort of code is used to achieve that:</p>
  
  <pre><code>string key = GetKeyForCurrentUser();
  MySessionContainer container = (MySessionContainer) Session[key];
  
  SomeBusinessObjectType businessObject = /* Get object from view. */;
  
  container.BusinessObjectList.Add(businessObject);
  </code></pre>
  
  <p>The generated key is always the same across all pages.</p>
  
  <p>However, when the user gets to the second page, the container is in session as expected but the list of business objects is empty which is not what I expect.  If the first page adds a business object, it should be there for the second and subsequent pages... right?</p>
  
  <p>Is there something I am not understanding about session in ASP.net?  Why is the container in session but not the list?  Is the list not serialized with the container object when ASP.net writes/reads it from session?</p>