title: Advice on using jquery ajax to return a excel file
body: <p>I have a web page that has a bunch of fields, and GET EXCEL button. Currently, when the user presses the GET EXCEL button, a js script collects the data from the fields, concocts a url to the Action Controller:</p>
  
  <p>in js:</p>
  
  <pre><code>$("excel-btn").onclick( function () {
  //get selected parameters:
      p1 = $("#p1").val();
      p2 = $("#p2").val();
      p3 = $("#p3").val();
  
      window.location = "myController/getExcel?p1=" + p1 + "&amp;p2=" + p2 + "&amp;p3=" + p3;
  });
  </code></pre>
  
  <p>In my controller action:</p>
  
  <pre><code>public ActionResult DownloadExcel(string p1, string p2, string p3)
  {
  
              //go to the database and get the data, shove it into the file
              return File(ms, "application/ms-excel", "myfile.xls"); 
   }
  </code></pre>
  
  <p>Question: 
  I would like to use jquery ajax to achieve the same result since I have more flexibility and can pass objects into the action, rather than append the required parameters to the query string. Is this possible? 
  If so, what would ajax return in this case? </p>
  
  <p>I am using asp.net MVC3</p>