title: Weird functionality when using ScriptManager.RegisterStartupScript
body: <p>I'm having this weird problem using the  ScriptManager.RegisterStartupScript. Basically what I'm trying to accomplish when I click a button control, it goes back to the server, checks to see if any errors, and <strong>what I want to happen</strong> is that if there are any errors, want to use a popup box. The button control is inside an update panel. I thought the easiest way to accomplish this was to use a javascript alert box. So I finally got it working but when the alert box comes up it messes up my menu control until the alert box is going then its ok. Its kinda of hard to explain so I have insert a image to show you guys whats going on once the button is clicked. I dont know how to fix or whats going on, if someone could point me into the right direction. Also he my code im using. <img src="https://i.stack.imgur.com/jtIfc.png" alt="enter image description here"></p>
  
  <pre><code> Protected Sub btnPlan_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnPlan.Click
  
   'Dim sb As New System.Text.StringBuilder
    sb.Append("&lt;script language='javascript'&gt;")
    sb.Append("alert(' No data in the database  ');")
    sb.Append("&lt;/script&gt;")
  
      If (Not ClientScript.IsStartupScriptRegistered("JSScript")) Then
          ScriptManager.RegisterStartupScript(UpdatePanel5, Me.GetType(), "JSScript", sb.toString(), True)
      End If
  </code></pre>