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 539907
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T10:11:08+00:00 2026-05-13T10:11:08+00:00

The following code works nicely: <script type=text/javascript> var prm = Sys.WebForms.PageRequestManager.getInstance(); prm.add_initializeRequest(InitializeRequest); prm.add_endRequest(EndRequest); function

  • 0

The following code works nicely:

<script type="text/javascript">
    var prm = Sys.WebForms.PageRequestManager.getInstance();
    prm.add_initializeRequest(InitializeRequest);
    prm.add_endRequest(EndRequest);

    function InitializeRequest(sender, args) {
        document.body.style.cursor = 'progress';
    }
    function EndRequest(sender, args) {
        document.body.style.cursor = 'default';
    }
</script>

When the response returns an attachment, though (a PDF from the ReportViewer control, for instance):

Response.AddHeader("Content-Disposition", "attachment; filename=some.pdf")

EndRequest() never fires and the “progress” cursor is not reset.
A Javascript call, e.g.

ScriptManager.RegisterStartupScript(this, this.GetType(), "close", 
   "parent.EndRequest(...);", true);

would do the trick, but is not possible because of the content disposition.
Can you think of a way to do this correctly – show a wait cursor while a PDF is rendered, and return to the normal cursor when the PDF is displayed? I am assuming a C# context here, but the problem is not language- or platform-specific.

  • 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-13T10:11:08+00:00Added an answer on May 13, 2026 at 10:11 am

    The problem seems to be that the EndRequest function is not being fired. Have you tried to see if the pageLoading and the pageLoaded events are firing?

    I have a feeling these events are not firing because there is nothing sent back to the page (the attachment doesn’t reach the page the same way an inline document does).

    I would move the file download into an iframe. Here is an example of how to do that:

    function InitializeRequest(sender, args) {
        document.body.style.cursor = 'progress';
    
        var iframe = document.createElement("iframe");
        iframe.src = 'your pdf file';
        iframe.style.display = "none";
        document.body.appendChild(iframe); 
    }
    

    Then you can access the onload event of the iframe.

    EDIT:

    Further searching led me to this page. It seems to do all that you’re looking to do.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 281k
  • Answers 282k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer create a new array twice the length of the input… May 13, 2026 at 3:57 pm
  • Editorial Team
    Editorial Team added an answer My advice would be to avoid this problem by avoiding… May 13, 2026 at 3:57 pm
  • Editorial Team
    Editorial Team added an answer It is clear that the Hibernate session is not open… May 13, 2026 at 3:57 pm

Related Questions

I've been wrestling with this for a while now. I have an app that
I'm using the following code to query my database: private const int PAGE_SIZE =
I've got the following MainView.xaml file that works well as a MVVM menu switcher.
i found the following solution to add sorting capabilities to jQuery (ref: jQuery sort()
In my Google Maps application I can place markers on the map, and I

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.