4

データグリッドからcsvを生成し、以下のコードを使用してダウンロードしています:

var context = HttpContext.Current;
                context.Response.ClearHeaders();            
                context.Response.ContentType = "application/vnd.ms-excel";
                context.Response.AppendHeader("Content-Disposition", "attachment; filename=" + filename);
                context.Response.Write(csvString);
                Response.Flush();

csv がダウンロードされますが、その下にページの html タグがあります。何が間違っている可能性がありますか?

4

1 に答える 1