How to use Session List<T> in asp.net to store value
<p>i made one property like this :</p>

<pre><code>public static List&lt;Message&gt; _SessionStore;
        public static List&lt;Message&gt; SessionStore
        {
            get
            {
                if(HttpContext.Current.Session["MyData"]==null)
                {
                    _SessionStore = new List&lt;Message&gt;();
                }
                return _SessionStore;
            }
            set { HttpContext.Current.Session["MyData"] = _SessionStore; }
        }
</code></pre>

<p>I want to add value <code>SessionStore.Add() and get SessionStore.Where()</code>
but i got error while doing this Add And Get</p>

<p>first i did <strong>SessionStore.Add(comment);</strong> somewhere then i got this error</p>

<pre><code> List&lt;Message&gt; msglist = HttpContext.Current.Session["MyData"] as List&lt;Message&gt;;
    if(msglist.Count&gt;0)
</code></pre>

<p>i am not able access <code>msglist</code></p>

<p>can anybody fix my property in way that i can use this List from anypage to add and get values</p>
