Having Trouble Using LINQ to Objects on the Controls Collection of a Page
<p>I need to store data from a form for recovery from the session.
Below is my rough first attempt for a generalized method for textboxes:</p>

<p>Load Session:</p>

<pre><code>Dictionary&lt;string, string&gt; AppInfo = (Dictionary&lt;string,string&gt;) Session["ApplicantionInfo"];
this.Controls.OfType&lt;TextBox&gt;()
         .ToList&lt;TextBox&gt;()
         .ForEach( x =&gt; x.Text = AppInfo[x.ID] );
</code></pre>

<p>Save Session:</p>

<pre><code>Session["ApplicationInfo"] = this.Controls.OfType&lt;TextBox&gt;()
                                  .ToList&lt;TextBox&gt;()
                                  .ToDictionary&lt;TextBox,string&gt;(kvp =&gt; kvp.ID);  
</code></pre>

<p>However, it appears that the Controls collection is not working for me. What am I doing wrong?</p>

<p><code>this.Controls.OfType&lt;TextBox&gt;()</code> yields no results at run time when I do a quick watch on it.</p>
