The action that causes this code to execute MUST be a postback event, and not an AJAX call.
This is due to the nature of the way AJAX requests are processed.
Mitchel Sellers
2009-10-12 13:57:44
The action that causes this code to execute MUST be a postback event, and not an AJAX call.
This is due to the nature of the way AJAX requests are processed.
On your button click, redirect to another page that can stream any files that you might want to do this type of thing with. We use a document.aspx page in many of our sites and then pass a document id via querystring and stream the file from there.
In your example, you're basically trying to change the headers for a page that's already been displayed which isn't allowed