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

  • Home
  • SEARCH
  • 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 135575
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T06:48:44+00:00 2026-05-11T06:48:44+00:00

I have a button on my webform. Clicking this button will do an HttpWebRequest

  • 0

I have a button on my webform. Clicking this button will do an HttpWebRequest during the onclick event handler. After the request we copy the response from the request into HttpContext.Current.Response and send that to the client.

This web request can take a while (up to 5 seconds, since it’s generating a report). During this time the user has no indication that anything is going on, except for the browser progress bar and the spinning IE icon (if they’re using IE). So I need a loading indicator while this is happening.

I’ve tried using javascript that fires during the button’s onclick event (using OnClientClick) and while that works, I don’t know how to find out when the web request is finished. Since we just send the response to the client, a full postback doesn’t happen.

I’ve tried wrapping the button in an UpdatePanel and using the UpdateProgress, but when we send the response to HttpContext.Current.Response and call Response.End(), we get an error in the javascript, since the response isn’t well formed (we’re sending back an excel sheet for the user to download).

Since we’re sending back a file for users to download, I don’t want to pop-up a separate window, since then in IE they’d get the information bar blocking the download.

Any ideas here?

  • 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. 2026-05-11T06:48:44+00:00Added an answer on May 11, 2026 at 6:48 am

    As an alternative to the Professional AJAX.NET library, jQuery has a really nice way of doing this.

    Take a look at this example of using a .NET PageMethod (if possible in your scenario).

    You define a page method call in jQuery, you can tack on your loading… message in a hidden div.

    Say what callback you want to return on success (ie when your 5 second report is generated) then hide the loading and handle the data.

    Take a look at the javascript on my contact page for an example (view the source).

    1. I have a a button on the page, add the jQuery onClick.
    2. When clicked that shows a hidden loading div, makes an ajax call to a page method that takes the parameters of the form.
    3. The page method does emailing etc then returns to the form in the onSuccess javascript method I have there.
    4. The onSuccess hides the loading div.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 195k
  • Answers 195k
  • 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 Change your $IFS setting to change how bash splits text… May 12, 2026 at 7:02 pm
  • Editorial Team
    Editorial Team added an answer In my recent project, I used java.util.Properties to track and… May 12, 2026 at 7:02 pm
  • Editorial Team
    Editorial Team added an answer OpenID is a method to authenticate users based on their… May 12, 2026 at 7:02 pm

Related Questions

Using VS2008 on my local dev machine, when I run my asp.net Web Application
I am relatively new to Silverlight development and I am trying to figure out
Similar questions to this one have been asked but none seem to address my
I have a usercontrol in ASP.Net featuring a button that I use to postback.

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.