title: DropDownList OnSelectedIndexChanged event stops working when seemingly unrelated User Control is added
body: <p>I have a page with a repeater. Inside each item of that repeater are update panels, each containing a control:</p>
  
  <pre><code>&lt;asp:Repeater ID="Repeater1" runat="server"&gt;
      &lt;ItemTemplate&gt;
          &lt;asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional"&gt;
              &lt;ContentTemplate&gt;
                  &lt;asp:Label ID="Label1" runat="server" Text='&lt;%# Eval("Property1") %&gt;' /&gt;
              &lt;/ContentTemplate&gt;
          &lt;/asp:UpdatePanel&gt;
          &lt;asp:UpdatePanel ID="UpdatePanel3" runat="server" UpdateMode="Conditional"&gt;
              &lt;ContentTemplate&gt;
                  &lt;asp:DropDownList ID="DropDownList1" runat="server" AutoPostback="true"
                      OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged"&gt;
                      &lt;asp:ListItem Text="1" Value="1" /&gt;
                      &lt;asp:ListItem Text="2" Value="2" /&gt;
                      &lt;asp:ListItem Text="3" Value="3" /&gt;
                      &lt;asp:ListItem Text="4" Value="4" /&gt;
                  &lt;/asp:DropDownList&gt;
              &lt;/ContentTemplate&gt;
          &lt;/asp:UpdatePanel&gt;
      &lt;/ItemTemplate&gt;
  &lt;/asp:Repeater&gt;
  </code></pre>
  
  <p>The code behind supplies the data source:</p>
  
  <pre><code>    protected void Page_Load(object sender, EventArgs e)
      {
          if (!Page.IsPostBack)
          {
              List&lt;Class1&gt; Source = new List&lt;Class1&gt;();
              Source.Add(new Class1("Test1"));
              Source.Add(new Class1("Test2"));
              Source.Add(new Class1("Test3"));
              Repeater1.DataSource = Source;
              Repeater1.DataBind();
          }
      }
  </code></pre>
  
  <p>And here is the class being bound:</p>
  
  <pre><code>public class Class1
  {
      public string Property1 { get; set; }
      public string Property2 { get { return "Property 2"; } }
      public Class1() { Property1 = string.Empty; }
      public Class1(string P1) { Property1 = P1; }
  }
  </code></pre>
  
  <p>And when the drop down list selected index is changed, this is the event that fires in the code behind:</p>
  
  <pre><code>    protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
      {
          DropDownList ddl = (DropDownList)sender;
          RepeaterItem ri = (RepeaterItem)ddl.NamingContainer;
          Label l = (Label)ri.FindControl("Label1");
  
          l.Text = ddl.SelectedValue;
  
          UpdatePanel up = (UpdatePanel)ri.FindControl("UpdatePanel1");
          up.Update();
      }
  </code></pre>
  
  <p>All of this code works just fine. When the selected index is changed, the label text is updated to match, and everything is happy.</p>
  
  <p>The problem is when I add a user control to the repeater. It doesn't seem to matter what the user control does, but here is a simple example I used to break this sample code:</p>
  
  <p>Front:</p>
  
  <pre><code>&lt;asp:Label ID="Label1" runat="server" /&gt;
  </code></pre>
  
  <p>Back:</p>
  
  <pre><code>public partial class WebUserControl1 : System.Web.UI.UserControl
  {
      private Class1 _Item = null;
      public Class1 Item { get { return _Item; } set { _Item = value; } }
  
      protected void Page_Load(object sender, EventArgs e)
      {
          Label1.Text = Item.Property1;
      }
  }
  </code></pre>
  
  <p>When I register this user control on the page:</p>
  
  <pre><code>&lt;%@ Register Src="WebUserControl1.ascx" TagName="Control1" TagPrefix="uc1" %&gt;
  </code></pre>
  
  <p>And place it inside the repeater in its own update panel:</p>
  
  <pre><code>&lt;asp:Repeater ID="Repeater1" runat="server"&gt;
      &lt;ItemTemplate&gt;
          &lt;asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional"&gt;
              &lt;ContentTemplate&gt;
                  &lt;asp:Label ID="Label1" runat="server" Text='&lt;%# Eval("Property1") %&gt;' /&gt;
              &lt;/ContentTemplate&gt;
          &lt;/asp:UpdatePanel&gt;
          &lt;asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional"&gt;
              &lt;ContentTemplate&gt;
                  &lt;uc1:Control1 ID="Control1" runat="server" Item='&lt;%# ((IDataItemContainer)Container).DataItem %&gt;' /&gt;
              &lt;/ContentTemplate&gt;
          &lt;/asp:UpdatePanel&gt;
          &lt;asp:UpdatePanel ID="UpdatePanel3" runat="server" UpdateMode="Conditional"&gt;
              &lt;ContentTemplate&gt;
                  &lt;asp:DropDownList ID="DropDownList1" runat="server" AutoPostback="true"
                      OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged"&gt;
                      &lt;asp:ListItem Text="1" Value="1" /&gt;
                      &lt;asp:ListItem Text="2" Value="2" /&gt;
                      &lt;asp:ListItem Text="3" Value="3" /&gt;
                      &lt;asp:ListItem Text="4" Value="4" /&gt;
                  &lt;/asp:DropDownList&gt;
              &lt;/ContentTemplate&gt;
          &lt;/asp:UpdatePanel&gt;
      &lt;/ItemTemplate&gt;
  &lt;/asp:Repeater&gt;
  </code></pre>
  
  <p>The user control paints correctly (suggesting it is working), but the OnSelectedIndexChanged event stops firing. Even inserting System.Diagnostics.Debugger.Break() inside the event doesn't fire. Everything else (the event code, the page load, the class) all remain the same. The only difference is adding this user control to the page and repeater.</p>
  
  <p>Can anyone tell me why the introduction of this (seemingly unrelated) user control seems to break the DropDownList behavior?</p>
  
  <p>Thanks for any help!</p>
  
  <p><strong>EDIT: Answered. I was just missing a Page.IsPostBack test in the Page_Load event of WebUserControl1. Silly mistake.</strong></p>