【发布时间】:2013-02-07 15:54:31
【问题描述】:
我正在尝试从屏幕上下载一些文本输出作为文本文件。以下是代码。它在某些页面上工作,而在其他页面上根本不工作。谁能建议这里有什么问题?
protected void Button18_Click(object sender, EventArgs e){
Response.Clear();
Response.Buffer = true;
Response.ContentType = "text/plain";
Response.AppendHeader("content-disposition", "attachment;filename=output.txt");
StringBuilder sb = new StringBuilder();
string output = "Output";
sb.Append(output);
sb.Append("\r\n");
Response.Write(sb.ToString());
}
【问题讨论】:
-
如果某人告诉你“它在某些页面上工作,而在其他页面上根本不工作”,你能解决他的问题吗?跨度>