title: How to hide loading animation when an open/save dialog is showm to the user?
body: <p>I have an export button in my application.
  When I click the button, it posts back to the server and generates an Excel file.</p>
  
  <p>I want to show a loading gif during the process, but when the open/save dialog shows, I want to hide the gif.</p>
  
  <p>The problem is that I use Response.End to display the file open/save dialog.</p>
  
  <p>Does anyone knows how can I call a client side function after Response.End, or anyone has another solution how can I hide the gif and let the user work?</p>
  
  <p>here is a piece of my code:</p>
  
  <pre><code>     protected void Page_Load(object sender, EventArgs e)
      {
          //starts the loading gif animation.
          btnExport.Attributes.Add("onclick", "setTimeout(\"UpdateImg();\",300);");
      }
  
      protected void btnExport_Click(object sender, EventArgs e)
      {
          //generates the file
          Response.ContentType = "application/vnd.openxmlformats-  officedocument.spreadsheetml.sheet";
          Response.AddHeader("content-disposition", "attachment;  filename=ExcelDemo.xlsx");
          Response.BinaryWrite(pck.GetAsByteArray());
          Response.Flush();
          //Response.End();
          HttpContext.Current.ApplicationInstance.CompleteRequest(); 
  
          //HERE I WANT TO STOP THE ANIMATION AND GO BACK TO THE PAGE!
      }
  </code></pre>
  
  <p>Thank you,
  Inbal.</p>