Object Reference not set to an instance or Index out of range error while adding values to lists
<p>Below is my class file which have different names than the one that is used in the project.</p>

<pre><code>public partial class College
{
public List&lt;Students&gt; Students;
}
public partial class Students
{
public List&lt;Activity&gt; Activity;
}
public partial class Activity{
public List&lt;string&gt; Name;
}
</code></pre>

<p>Below is my aspx.cs code</p>

<pre><code>            College.Students.Add(new Students{ studentno= studentnumber.text});
            int index2 = College.Students.FindIndex(c =&gt; c.studentno== lineno);
            College.Students[index2].Activity= new List&lt;Activity&gt;();
            College.Students[index2].Activity.Add(new Activity{ });
            int k = (College.Students[index2].Activity.Count) - 1;

            College.Students[index2].Activity[k].Name = new List&lt;string&gt;();

            string ctrlStr = String.Empty;

            foreach (string ctl in Page.Request.Form)
            {
                if (ctl.Contains("Name"))
                {
                    ctrlStr = ctl.ToString();
                    College.Students[index2].Activity[k].Name[0] = (Request.Form[ctrlStr]);--- It errors out here...not understanding the reason...Am i missing any line of code

                }
</code></pre>
