title: Injecting JavaScript Outside an Update Panel
body: <p>I have an aspx page with four UpdatePanels. Incidentally, each UpdatePanel corresponds to a JQuery UI tab. What I am trying to achieve is a JQuery UI modal dialog OUTSIDE the UpdatePanels that can be called from server-side code running INSIDE any of the UpdatePanels. So, inside the first UpdatePanel is an asp:Button which runs some server-side code. When an error ocurrs, I want to be able to inject some JavaScript that will call the modal dialog to display the error message. Here is the code I am using:</p>
  
  <pre><code>Dim script As String = "showPopupMessage('{0}');"
  script = String.Format(script, errorMessage)
  ScriptManager.RegisterStartupScript(Me.UpdatePanelBizInfo, Me.UpdatePanelBizInfo.GetType, Guid.NewGuid.ToString, script, True)
  </code></pre>
  
  <p>The showPopupMessage function on the page looks like this:</p>
  
  <pre><code>function showPopupMessage(msg) {
      $('#&lt;%=Me.LabelPopupMessage.ClientID %&gt;').text(msg);
      $('#dialogPopupMessage').dialog('open');
  }
  </code></pre>
  
  <p>When the code runs to inject the JavaScript, nothing happens. I am assuming it has something to do with the fact that the error ocurrs in the code running inside an UpdatePanel. Upon inspecting the resulting HTML, the JavaScript is there. What am I doing wrong?</p>