Help - cannot postback after sending file to client

Joined
Jun 22, 2005
Messages
8
Reaction score
0
I am having great difficult with this particular bit of code.
I have a button which displays a JavaScript "please wait" busy-bar after it is clicked.
This control was downloaded from TheCodeProject.

Now, the problem I am having is ..

when the button is clicked, it generates a report which is output to a new window.

After this is output though, it refuses to PostBack to the original page. The upshot of this is ..

1) I cannot display any "Report Completed" confirmation text

2) the "please wait" animated gif continues to display until the user presses a button.

I need this to be postbacked from the Server, because the report can take a varying amount of time to create

Here is my code, which occurs on the button.Click() event.

Code:
// this variable contains my output report
string Outs = "...";

// Output to a new window .. this code DOES work .. and the output report file is
// sent to the client and opened in MS Excel
Response.AddHeader("Content-Disposition", "attachment; filename=Recharge_Summary.xls");
Response.ContentType = "application/vnd.ms-excel";
Response.Write(Outs);
Response.Flush();

// Refresh the current window, which resets the "please wait" graphic
Response.Write("Hello World");
Response.End();

After this ... nothing happens ... no Postback .. the graphic just continues on as normal

I have also tried adding the following ... which should force the current page to refresh. I don't get any errors, it just doesn't work!

Code:
Response.Write(@"<script>window.location.assign(window.location.href)</script>");


Can anyone help??

please ??
 
Last edited:

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top