title: How prevent page refresh with ASP.NET Ajax using Dropdownlist
body: <p>I want to populate a second dropdownlist based on the index of the first. </p>
  
  <pre><code>&lt;asp:ScriptManager ID="sm" runat="server" /&gt;
  
  &lt;asp:DropDownList ID="ddl1" runat="server" AutoPostBack="true"    OnSelectedIndexChanged="ddl1_SelectedIndexChanged"&gt;
      &lt;asp:ListItem Value="1" /&gt;
      &lt;asp:ListItem Value="2" /&gt;
  &lt;/asp:DropDownList&gt;
  
  &lt;asp:UpdatePanel ID="up" runat="server"&gt;
  &lt;Triggers &gt;
      &lt;asp:AsyncPostBackTrigger ControlID="ddl1"    EventName="SelectedIndexChanged" /&gt;
  &lt;/Triggers&gt;
  &lt;ContentTemplate &gt;
  &lt;asp:DropDownList ID="ddl2" runat="server"&gt;
  &lt;asp:ListItem Value="1" /&gt;
  &lt;asp:ListItem Value="2" /&gt;
  &lt;/asp:DropDownList&gt;
  &lt;/ContentTemplate&gt;
  &lt;/asp:UpdatePanel&gt;
  </code></pre>
  
  <p>Code Behind:</p>
  
  <pre><code> protected void ddl1_SelectedIndexChanged(object sender, EventArgs e)
   {
      ddl2.SelectedIndex = ddl1.SelectedIndex;
   }
  </code></pre>
  
  <p>I am getting a complete post back. No ajax at work.</p>