title: Hide image using Javascript after controller action is complete MVC3
body: <p>My application has been implemeted using MVC 3, .net.
  I am trying to generate an excel file at the click of a button.
  The call to the controller action is made using Ajax.
  My main problem is: During the file generation i am trying to display an image on the screen to let the user know of the ingoing operation. I can very well display the image but i cannot hide it after the operation is completed. The codei am using is :</p>
  
  <p>Javascript code:</p>
  
  <pre><code>$("input.DownloadExcelReport").click(function (e) {
     e.preventDefault();
     var parameter = -- code to fetch parameter value;
     var outputViewUrl = (the url is created here);
     showLoading(); -- This function displays the image
     window.location.href = outputViewUrl;
  });
  </code></pre>
  
  <p>Controller Action code:</p>
  
  <pre><code>public ActionResult DownExcelReportForAssortment(Guid parameter)   
  {
  
         try
         {
  
             //the contents for the file generation are fetched here..   
             // Write contents to excel file
             if (memoryStream != null)
             {
                  var documentName = "Report.xls";
                  byte[] byteArrary = memoryStream.ToArray();
                  return File(byteArrary, "application/vnd.ms-excel", documentName);
             }
         }
         catch (Exception ex)
         {
             LogManager.LogException(ex);
         }
  }
  </code></pre>
  
  <p>I do not return a Json result to the calling javascript method where i can write the code to hide the image.
  I am returning a file which can be saved by the user and the action is completed.</p>
  
  <p>Can somone please suggect/help me of how can i hide the image once the file generation operation is complete?</p>
  
  <p>Appreciate the help...</p>