title: File download link in ASP.NET MVC application
body: <p>In my MVC application when user clicks a particular link(a href) , an image will be downloaded.</p>
  
  <p>Below is the action code which downloads the image  </p>
  
  <pre><code>public ActionResult Download()
      {
          try
          {
              HttpClient client = new HttpClient();
              byte[] data = client.GetByteArrayAsync("http://public.slidesharecdn.com/b/images/logo/linkdsfsfsfsfedin-ss/SS_Logo_White_Large.png?6d1f7a78a6").Result;
              return File(data, "application/jpg", "testimage.jpg");
          }
          catch (Exception err)
          {
              return new HttpNotFoundResult();
          }
      }
  </code></pre>
  
  <p>But incase of exception it will display default IIS "HTTP Error 404.0 - Not Found" page,
  instead I would like to display javascript alert "Image not found". </p>
  
  <p>To implement this requirement , do I need to make an AJAX call, instead of
  direct HTTP GET?</p>