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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T06:49:39+00:00 2026-06-05T06:49:39+00:00

I have an export button in my application. When I click the button, it

  • 0

I have an export button in my application.
When I click the button, it posts back to the server and generates an Excel file.

I want to show a loading gif during the process, but when the open/save dialog shows, I want to hide the gif.

The problem is that I use Response.End to display the file open/save dialog.

Does anyone knows how can I call a client side function after Response.End, or anyone has another solution how can I hide the gif and let the user work?

here is a piece of my code:

     protected void Page_Load(object sender, EventArgs e)
    {
        //starts the loading gif animation.
        btnExport.Attributes.Add("onclick", "setTimeout(\"UpdateImg();\",300);");
    }

    protected void btnExport_Click(object sender, EventArgs e)
    {
        //generates the file
        Response.ContentType = "application/vnd.openxmlformats-  officedocument.spreadsheetml.sheet";
        Response.AddHeader("content-disposition", "attachment;  filename=ExcelDemo.xlsx");
        Response.BinaryWrite(pck.GetAsByteArray());
        Response.Flush();
        //Response.End();
        HttpContext.Current.ApplicationInstance.CompleteRequest(); 

        //HERE I WANT TO STOP THE ANIMATION AND GO BACK TO THE PAGE!
    }

Thank you,
Inbal.

  • 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-06-05T06:49:40+00:00Added an answer on June 5, 2026 at 6:49 am

    This way you can not do that.

    When you start send your data to the file and open a save dialog, your web page have lost the control and you can not do anything any more, the data are all go to the file save.

    What other and in my opinion better, options you have.

    You can use a handler .ashx to create and send your file, and you give the link to your page with the parameters you need to make the file.

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

Sidebar

Related Questions

In my application i have to export the excel file which I have achieved
In my application (Delphi Xe2) I have 'multichoice' button (ie 'Export' Button have 'Export
I have to Export to excel from my asp.net page.I want to take the
I have button on my page for Export To Excel. The ButtonClick function is
I have DataGridView and when I display export to excel sheet button following error
I have an Export to CSV button that exports all car models. When I
So I have an 'export' application that arrives the user at an end page
We have manage to export data from our mysql table into a .txt file.
I have been trying to export some datagrids in Silverlight to excel, but have
I have a requirement to export a dataset as a CSV file. I have

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.