title: how to call a javascript function from codebehind in asp.net
body: <pre><code>protected void addSchoolButtonClick(object sender, ImageClickEventArgs e)
      {
  
          Page.ClientScript.RegisterStartupScript(GetType(), "MyKey1", "SchoolSearchPopUp();", true);
  
          /*Some code*/
      }
  </code></pre>
  
  <p>I am developing a website in asp.net.At a Hyperlink onclick event i want to call a javascript <code>function"SchoolSearchPopUp()"</code>.this function is for creating a new popup window and it is working correctly.But my problem is ,a javascript function is calling or pop window opens only after executing the rest of the code in that function and that code need's some data that occurs as a result of popup.How can i create the popup before executing the rest of code in  that function.</p>