Object reference not set to an instance of an object error though I am instantiationg the object
<pre><code>  public partial class College
  {
    public CollegeDetails CollegeDetails;
    public List&lt;Students&gt; Students;
    public StaffDetails StaffDetails;
  }

 public partial class Students 
 {
    public StudentDetails StudentDetails ;
    public List&lt;Marks&gt; Marks;
 }
</code></pre>

<p>in my aspx.cs file</p>

<pre><code>        College college = new College ();
    Students students= new Students (); 
    //List&lt;Students&gt; students = new List&lt;Students&gt;; 
     if (IsValidPost())
            {
                if (Session["xml"] == null)
                {
                    college.students.Add(new students{ });
                    Addtogrid();
                }
                else
                {
                    college = (College)(Session["xml"]);

                    if (college.students.Count == 0)----getting object refernce erro here
                    {
                        college.students.Add(new students{ });
                    }

                    Addtogrid();
                 }
            }
            else
            {
                if (Session["xml"] != null)
                {
                 }
</code></pre>

<p>Please help.</p>
