このコードをローカル マシンの gridview からの Excel へのエクスポートとして使用しています.....
void btn_excelClick()
{
Response.ClearContent();
Response.Buffer = true;
Response.AddHeader("content-disposition", string.Format("attachment; filename={0}", "c.xls"));
Response.ContentType = "application/vnd.ms-excel";
Response.Charset = "";
StringWriter sw = new StringWriter();
HtmlTextWriter htw = new HtmlTextWriter(sw);
GridView2.RenderControl(htw);
Response.Write(sw.ToString());
Response.End();
}
私の質問は次のとおりです。エンドユーザーがファイルをクリックしたときにファイルがサーバー側でダウンロードされ、ソースファイルのダウンロードリンクがポップアップするように、コードをどのように変更すればよいですか。
PS: 私のコンプは現在私のサーバーです...