求助啊。? 上面这个代码该怎么改??
解决方案 »
- JS button如何点一个隐藏的ASP.NET的Button
- 纠结的问题 DROPDOWNLIST点击没有反应
- 求助gridview自带的删除,弹出提示框问题。困惑很多天了
- 想做个网站有些迷茫,请有经验的人给予指点
- 询问SQL Server数据表之间的数据转存问题
- c#里datagridview中统计的问题
- My97DatePicker 日期改变后 怎么去调用后台的方法
- 有一个关于报表生成的需求。。求思路
- 我的visual studio.net 在调试的时候为什么“局部变量”不出来???
- 怎样才能查看asp.net的帮助文档啊
- 当SqlDataReader读取到多行数据时怎样依次获取所有行的数据
- 求大神分享自定义列的Demo~
<a href='123.xls'>下载</a>
或者 public static void downloadfile(string s_fileName)
{
HttpContext.Current.Response.ContentType = "application/ms-download";
string s_path = HttpContext.Current.Server.MapPath("~/") + s_fileName;
System.IO.FileInfo file = new System.IO.FileInfo(s_path);
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.AddHeader("Content-Type", "application/octet-stream");
HttpContext.Current.Response.Charset = "utf-8";
HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(file.Name, System.Text.Encoding.UTF8));
HttpContext.Current.Response.AddHeader("Content-Length", file.Length.ToString());
HttpContext.Current.Response.WriteFile(file.FullName);
HttpContext.Current.Response.Flush();
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.End();
}