Frameset appears to freeze

G

Guest

Guys,

I have a three frame frameset: a title bar at top, a menu bar on the left, and a "main" frame where the business logic happens.

On one page, I need to offer an "Export to Excel" button. When I click this button the download happens, but then the menu bar appears to freeze. What happens is that the page selected is created and sent, but the page offering "Export to Excel" is just redisplayed, so nothing appears to happen.

The above problem only occurs if I save the CSV file to disk. Displaying in Excel with the "Open" option does not cause this.

My code is below:

Response.Buffer = true;
Response.ContentType = "text/plain";
Response.AddHeader("Content-Disposition", "attachment; filename=MyFile.csv");

string FileContents = "Number,Again\r\n";
for (int ctr = 1; ctr <= 10; ctr++)
{
FileContents += ctr.ToString() + "," + ctr.ToString() + "\r\n";
}
Response.Write(FileContents);
Response.Flush();
Response.SuppressContent();
Response.End();

Thanks,
Simon.
 

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

Members online

Forum statistics

Threads
473,999
Messages
2,570,247
Members
46,844
Latest member
JudyGvh32

Latest Threads

Top