title: Alert fails in UpdatePanel
body: <p>I'd like to get an alert from the server inside of an AJAX call in an <code>Update Panel</code> but something is blocking the <code>HttpContext.Current.Response.Write</code> from firing on the client.</p>
  
  <p>Here's a very simple aspx body content</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;form id="form1" runat="server"&gt;
  &lt;asp:ScriptManager ID="ScriptManager1" runat="server"&gt;
  &lt;/asp:ScriptManager&gt;
  &lt;div&gt;
      &lt;asp:UpdatePanel ID="UpdatePanel1" runat="server"&gt;
          &lt;ContentTemplate&gt;
              &lt;!-- DropDownList doesn't work here --&gt;
          &lt;/ContentTemplate&gt;
      &lt;/asp:UpdatePanel&gt;
      &lt;asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True"&gt;
          &lt;asp:ListItem Value="1"&gt;First&lt;/asp:ListItem&gt;
          &lt;asp:ListItem Value="2"&gt;Second&lt;/asp:ListItem&gt;
      &lt;/asp:DropDownList&gt;
  &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>And here's where I'm handling it in VB</p>
  
  <pre class="lang-vb prettyprint-override"><code>Protected Sub DropDownList1_SelectedIndexChanged(sender As Object, e As EventArgs) _
          Handles DropDownList1.SelectedIndexChanged
      Dim alertMsg As String
      Dim alertScript As String
      'DO OTHER STUFF HERE
      alertMsg = String.Format("You Selected {0}", DropDownList1.SelectedItem.Text)
      alertScript = String.Format("&lt;script type= text/javascript&gt;alert('{0}');&lt;/script&gt;", alertMsg)
  
      System.Web.HttpContext.Current.Response.Write(alertScript)
  
  End Sub
  </code></pre>
  
  <p>Both times the vb code will fire, but it only scripts an alert message when called outside the the UpdatePanel, instead of inside it.</p>
  
  <p>What am I doing wrong?</p>