CSV file download ignored in ie8/9

I have some code in a button click event which gets a csv string from a hidden input and writes it to the response as a CSV file.

This work fine in Chrome, Firefox, ie7, ie9 in quirks mode. However it does not work in ie8 or ie9 default.

Looking at this in fiddler the csv is being written to the response but the another get request is being made immediately after and the page reloads. No file saving dialog appears.

    protected void btnCsvHidden_Click(object sender, EventArgs e)
    {
        var csv = csvString.Value;
        var filename = "Reporting";

        Response.Clear();
        Response.ClearHeaders();
        Response.AddHeader("Cache-Control", "no-store, no-cache");
        Response.AddHeader("content-disposition", "attachment; filename="" + filename + ".csv"");
        Response.ContentType = "text/csv";
        Response.Write(csv);
        Response.End();
    }

问题出在我自己的IE上,我跑了一大堆Windows更新,现在它可以工作,所以我不确定它到底是什么。

链接地址: http://www.djcxy.com/p/36528.html

上一篇: Javascript:为什么我们的网站在终端服务会话中速度非常慢?

下一篇: 在ie8 / 9中忽略CSV文件下载