Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6636467
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:11:22+00:00 2026-05-25T23:11:22+00:00

Basically the issue is this: I have a pdf file that I am requesting

  • 0

Basically the issue is this:

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:

        $('.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
        });
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T23:11:23+00:00Added an answer on May 25, 2026 at 11:11 pm

    Yes, don’t use AJAX to download files. Simply redirect in javascript by passing the pReference as query string parameter:

    window.location.href = '@Url.Action("PrintFromGrid", "Home")?pReference=' + encodeURIComponent(primaryReference);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this script that basically will show a product or products based on
I have this issue that I can't seem to get my head around... Basically
I have this dirty html that is currently used in my company, the issue
I'm seeing basically the same issue described here I have a table that starts
Hey, so basically I have this issue, where I'm trying to put an equation
Okay, so I have an issue with an AJAX request. I currently have this
I have this issue with Core Data. I am creating a core-data-based application, for
I have searched on Google, jQuery, and stackoverflow for this issue and all basically
This issue is very likely codeigniter specific. I have a controller called redirect.php that
I have a small issue that I don’t really know how to solve, basically

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.