私は次のことをするボタンを持っています:
Response.Clear();
Response.Buffer = true;
Response.AddHeader("content-disposition", "attachment;filename=GridViewExport.csv");
Response.Charset = "";
Response.ContentType = "application/text";
//my content is created
Response.Output.Write(sb.ToString());
Response.Flush();
Response.End();
これは私のボタンの定義です:
<asp:Button ID="Button1" runat="server" onclick="Excel_Click" Text="Export to Csv" onclientclick="ShowModal();"/>
ご覧のとおり、私はjavascript関数を呼び出します。この関数は次のことを行います。
function ShowModal() {
var divmodal = document.getElementById("divModal");
divmodal.style.display = '';
}
つまり、「Loading」というラベルの付いたモーダルウィンドウが表示されます。ファイルをダウンロードすると、csvが生成されますが、その後もモーダルウィンドウが表示されます。これは、ページが更新されていないためです。
何か私にできることはありますか?
前もって感謝します