Content Disposition Problem with IE

R

Ramjee Tanguturi

Hi,

I face this peculiar problem. I have an export to excel functionality
in my ASP.NET application. I set the Response.ContentType and Content
Disposition properties of the page as

Page.Response.ContentType="application/vnd.ms-excel";
Page.Response.AddHeader("Content-Disposition",
"filename=Results.xls");

This page has data displayed on a grid.

Now when I open this page, it prompts for Open / Save… which is what I
want exactly. When I click on Open it opens the excel in IE… This is
Fine. But when I choose Save option, it opens the Save Dialog box
where I select the destination folder, click on save to save the file.
But the page that opened initially whose COntentType and AddHeader
have been set to open in Excel does not close automatically, rather it
displays the "Action Cancelled" error. My requirement is, once I
choose to save, it should close the page and not show "Action
Cancelled".

Any pointers on this would be of great help.

Thanks Much,
Ramjee
 

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,968
Messages
2,570,149
Members
46,695
Latest member
StanleyDri

Latest Threads

Top