title: web api download xml file from javascript
body: <p>I try to use web api to return a list of items.</p>
  
  <p>This is my Controller :</p>
  
  <pre><code>public class RecipesController : ApiController
  {
      /// &lt;summary&gt;
      /// Model to get recipes datas
      /// &lt;/summary&gt;
      private readonly RecipeModel _recipeModel = new RecipeModel();
  
      /// &lt;summary&gt;
      /// Gets the recipe by division identifier.
      /// &lt;/summary&gt;
      /// &lt;param name="id"&gt;The div identifier.&lt;/param&gt;
      [ActionName("Division")]
      public Adoria GetRecipeByDivisionId(int id)
      {
          return _recipeModel.GetRecipeByDivisionId(id);
      }
  }
  </code></pre>
  
  <p>For the moment, this is called by an ASP page using JavaScript : </p>
  
  <pre><code>function RedirectToReport(){
  var url = $("#valSelectedCheckBox").val(); // url of my web api method
  location.href = url;
  }
  </code></pre>
  
  <p>It displays the xml file on the browser.</p>
  
  <p>I don't want to display it on the browser but download it.</p>
  
  <p>Do you have an idea of the purpose ?</p>