title: ASP.NET How to open a second popup on close() event of first
body: <p>I want to open a popup window with some parameters inside and then open a new one (or even more than one) with different parameters, after the user closes the first.</p>
  
  <p>It should be like a <code>foreach</code> loop where it waits for the closing event before opening a new window.</p>
  
  <p><em>I'm using .NET Framework v3.5.</em></p>
  
  <pre><code>foreach (object o in ObjectsList)
  {
      // Do some stuff...
  
      // Set query string for popup        
      string queryString = string.Format("Page.aspx?doc={0}, o.ID);
  
      string urlDownload = Page.ResolveClientUrl(string.Format("~/Path/To/Folder/{0}", queryString));
  
      string script = string.Format("loadDownload('{0}','_blank',600,600);", urlDownload);
  
      // Open popup window
      ScriptManager.RegisterStartupScript(Page, Page.GetType(), "DocID" + o.ID, script, true);
  
      // Wait for popup close event before proceeding...
  }
  </code></pre>