ListBox is null in Select method of ObjectDataSource
<p>I couldn't come up with a good subject.  I have a simple ASP.NET 3.5 form.  If you follow the numbered comments, I explain how I am stepping through the code when I run the page in debug mode.  Both of the below functions are methods declared in the code behind file of the page, both are in the same _Default class.  The ManagersListBox is declared in the Default.aspx page.  Why is it that in the context of the GetSubordinates, the ManagersListBox is null?  It's as if it disappears for a moment and then reappears after returning from the GetSubordinates method.  Obviously the solution is to parameterize GetSuborindates, but that is not my concern.  I am trying to learn how ASP.NET works and I would really like to understand why I am seeing this behavior "disappearing object".  Thanks.</p>

<pre><code>    &lt;asp:ListBox ID="ManagersListBox" runat="server" Width="293px" 
         DataTextField="LoginID" DataSourceID="ObjectDataSource2"
        DataValueField="EmployeeID" onload="ManagersListBox_Load"                     
        AutoPostBack="true" onprerender="ManagersListBox_PreRender"&gt;&lt;/asp:ListBox&gt;


    &lt;asp:ObjectDataSource ID="ObjectDataSource2" runat="server" 
        SelectMethod="GetSubordinates" TypeName="WebApplication._Default"&gt;
    &lt;/asp:ObjectDataSource&gt;
</code></pre>

<p>Code behind file:</p>

<pre><code>protected void ManagersListBox_PreRender(object sender, EventArgs e)
{

    if (ManagersListBox != null)
    {
        //1. Right here, ManagersListBox is not null
    }

    //2. This call causes the ObjectDataSource to call GetSubordinates
    ObjectDataSource2.Select();
    //4. After stepping out of GetSubordinates and back here,
    //   ManagersListBox is again non-null.
}

public List&lt;DataModel.Employee&gt; GetSubordinates()//int ManagerID)
{
    //3. ManagersListBox is always null here
    using (DataModel.AdventureWorksEntities entities = new DataModel.AdventureWorksEntities())
    {                
        if (ManagersListBox != null)
        {

            return (from employee in entities.Employees
                    where employee.Manager.EmployeeID == Convert.ToInt32(ManagersListBox.SelectedValue)
                    select employee).ToList();
        }
        else
        {
            return (from employee in entities.Employees                            
                    select employee).ToList();
        }
    }
}
</code></pre>
