【发布时间】:2009-11-03 07:38:05
【问题描述】:
我有一个文件的链接,但我不知道如何将它添加到 imagebutton。我想在单击 imagebutton 时看到 'open-save-cancel' 屏幕,但 imagebutton 似乎没有将文件的链接作为文件,而是将其作为页面 url 并试图打开文件 url作为页面。
谢谢
【问题讨论】:
标签: c# .net file dynamic imagebutton
我有一个文件的链接,但我不知道如何将它添加到 imagebutton。我想在单击 imagebutton 时看到 'open-save-cancel' 屏幕,但 imagebutton 似乎没有将文件的链接作为文件,而是将其作为页面 url 并试图打开文件 url作为页面。
谢谢
【问题讨论】:
标签: c# .net file dynamic imagebutton
//OnClick server Handler
Response.Clear();
Response.AddHeader(
"content-disposition", string.Format("attachment; filename={0}", "file_name"));
Response.ContentType = "application/octet-stream";
Response.WriteFile("file_path");
Response.End();
【讨论】: