title: Downloading PDF File with AJAX/MVC 3
body: <p>Basically the issue is this:</p>
  
  <p>I have a pdf file that I am requesting from a server based on the currently logged in user's ID and the OID. In order to get the OID, I have to parse a value from a HTML table based on the button the user clicks on and then send it to the home controller. Then an API call is run to grab the OID. Another API call is then made with the OID to pull the PDF file. AJAX is used to send the the parsed HTML value to the home controller using this code here:</p>
  
  <pre><code>        $('.pdfPrint').live('click', function () {
              $(this).addClass('selectedDetails');
              var parent = $('.selectedDetails').parents('tr');
              var tr = $(this).parents('tr');
              var td = tr.children();
              var i = 0;
              td.each(function () {
                  $(this).addClass('tdGrid' + i);
                  i++;
              });
              var primaryReference = "";
              primaryReference = $('.tdGrid1').text();
              gridClassRemover();
              $.ajax({ // create an AJAX call...
                  data: { pReference: primaryReference }, // get the form data
                  type: "POST", // GET or POST
                  url: "/Home/PrintFromGrid", // the file to call
                  success: function (response) { // on success..
                      callTrackDialog();
                      // update the DIV                         
                  },  // end of success
                  error: function () {
                      alert('An error has occurred. If this problem persists please contact support.');
                  }
              });  // end of .ajax
          });
  </code></pre>