title: Changing A label text without PostBack (using Update Panels)
body: <p>i created an ASP.NET Website. 
  What i want to do is to make a label change its content depending on the item selected by a drop down list.
  I tried this but it didn't work:</p>
  
  <p>The Drop down list looks like this:</p>
  
  <pre><code>&lt;asp:DropDownList ID="DropDown1" runat="server" &gt;
      &lt;asp:ListItem Value="a"&gt;&lt;/asp:ListItem&gt;
      &lt;asp:ListItem Value="b"&gt;&lt;/asp:ListItem&gt;
      onselectedindexchanged="DropDown1_SelectedIndexChanged"
  &lt;/asp:DropDownList&gt;
  </code></pre>
  
  <p>the label:</p>
  
  <pre><code>&lt;asp:Label ID="Label1" Text="" runat="server"/&gt;
  </code></pre>
  
  <p>I want to do it without having to use <strong>PostBack</strong>.</p>
  
  <p>I tried to use ajax <strong>Update panel</strong> Like this:</p>
  
  <pre><code>&lt;asp:UpdatePanel runat="server" id="UpdatePanel" updatemode="Conditional"&gt;        
      &lt;Triggers&gt;
          &lt;asp:AsyncPostBackTrigger controlid="DropDown1"                                       EventName="SelectedIndexChanged" /&gt;
      &lt;/Triggers&gt;
      &lt;ContentTemplate&gt;
          &lt;asp:Label ID="Label1" Text="" runat="server"/&gt;
      &lt;/ContentTemplate&gt;
  &lt;/asp:UpdatePanel&gt;
  </code></pre>
  
  <p>And in the <strong>DropDown1_SelectedIndexChanged</strong> Event in the <strong>code behind</strong>:</p>
  
  <pre><code>protected void DropDown1_SelectedIndexChanged(object sender, EventArgs e)
  {
      Label1.Text = DropDown1.SelectedValue;
  }
  </code></pre>
  
  <p>But this is not working.</p>
  
  <p>Can anyone Help me with it?</p>
  
  <p>Thank you very much for any help</p>