ASP.NET と Response で問題に直面しています。
私がやりたいことは本当にシンプルです: ボタンのクリック、ファイルの生成、ファイルのダウンロード。
私はこれを達成できますが、同じボタン (または別のボタン) をクリックしようとすると、ページがフリーズしているように見えます: ポストバックもイベントもありません..
ページをフリーズせずにファイルを返すにはどうすればよいですか?
私が使用しているコードは次のようなものです。
var xls = GridViewExportUtil.Export((IEnumerable<ConfigurationReportSummary>)table.DataSource, "WebSiteConfig.xls");
this.Response.ContentType = @"application/vnd.ms-excel";
this.Response.AppendHeader("Content-Disposition", @"Attachment; filename=""WebSiteConfig.xls""");
this.Response.Charset = string.Empty;
this.Response.ContentEncoding = System.Text.Encoding.Default;
this.Response.BinaryWrite(xls.ToArray());
this.Response.Flush(); //Also tried without this
this.Response.End(); //Also tried without this
どうもありがとうございました!