我的“下载按钮”上有这段代码。是的,它下载到记事本,但我想要的是当用户单击“下载按钮”时,将出现一个 SAVE-AS 文件对话框,可以保存和重命名文件。请帮助!
protected void btn_export_Click(object sender, EventArgs e)
{
TextWriter sw = new StreamWriter(@"C:\SumTotal\file11.txt");
int rowcount = GridView1.Rows.Count;
for (int i = 0; i < rowcount - 1; i++)
{
sw.WriteLine(GridView1.Rows[i].Cells[28].Text.ToString() + "\t");
}
sw.Close(); //Don't Forget Close the TextWriter Object(sw)
Response.Write("Data Successfully Exported");
}