title: Rebinding on Postback Based on Selected DropDown Value
body: <p>Greetings!</p>
  
  <p>I have a DropDownList within a FormView which are bound to XmlDataSources:</p>
  
  <pre><code>&lt;asp:FormView ID="MyFormView" runat="server" DataSourceID="MyXmlDataSource"&gt;
      &lt;ItemTemplate&gt;
          &lt;h1&gt;&lt;%# XPath("SomeNode")%&gt;&lt;/h1&gt;
          &lt;asp:Label ID="MyLabel" runat="server" AssociatedControlID="MyDdl" Text='&lt;%# XPath("SomeOtherNode")%&gt;' /&gt;
          &lt;asp:DropDownList ID="MyDdl"
                            runat="server"
                            DataSourceID="MyDdlDataSource"
                            DataTextField="name"
                            DataValueField="value"
                            AutoPostBack="true"
                            OnSelectedIndexChanged="MyDdl_SelectedIndexChanged"&gt;
          &lt;/asp:DropDownList&gt;
      &lt;/ItemTemplate&gt;
  &lt;/asp:FormView&gt;
  &lt;asp:XmlDataSource ID="MyXmlDataSource" runat="server" XPath="Root/MainSection" /&gt;
  &lt;asp:XmlDataSource ID="MyDdlDataSource" runat="server" XPath="Root/MainSection/Areas/*" /&gt;
  </code></pre>
  
  <p>In the page's codebehind, I have the following OnLoad() method as well as the method for when the select index of the dropdownlist changes:</p>
  
  <pre><code>protected override void OnLoad(EventArgs e)
  {
      base.OnLoad(e);
  
      if (!IsPostBack)
      {
          string xml = GetMyXml(0); // default value
          MyXmlDataSource.Data = xml;
          MyDdlDataSource.Data = xml;
      }
  }
  
  protected void MyDdl_SelectedIndexChanged(object sender, EventArgs e)
  {
      DropDownList l_MyDdl = FindControl("MyDdl") as DropDownList;
      int myVal;
      if (l_MyDdl != null)
          if (!Int32.TryParse(l_MyDdl.SelectedItem.Value, out myVal))
              myVal = 0;
      string xml = GetMyXml(myVal);
      MyXmlDataSource.Data = xml;
      MyDdlDataSource.Data = xml;
  }
  </code></pre>
  
  <p>When a different value is selected from the dropdown list and SelectedIndexChanged is invoked, I am unable to get the value of the dropdown list (FindControl always returns null) in order to use it to re-bind the datasources.  How can I get this value?</p>