title: Modalpopup windows appears after the whole function is processed
body: <p>I have a modal popup window that I want displayed at the start of the function. Instead, it appears after the function has been processed.  </p>
  
  <pre><code>    protected void RadListView1_SelectedIndexChanged(object sender, EventArgs e)
      {
          string script = "function f(){$find(\"" + DisclaimerAlertWindow.ClientID + "\").show(); Sys.Application.remove_load(f);}Sys.Application.add_load(f);";
          ScriptManager.RegisterStartupScript(Page, Page.GetType(), "key", script, true);  
  
  
  // other business logic
  }  
  </code></pre>
  
  <p>How can I get the modalpopup to be displayed when the function is called?</p>