在线下载功能,求救····················

woshiliourun 2011-07-28 11:27:45
我用A标签
lblContent.Text = material.MContent + "<br/><a href=\"" + material.MPath.Replace("~", "..") + "\" target=\"_blank\">点击下载</a>";
现在 点击后就变成了在线打开一个新的网页显示要下载的内容了··
没有分了···20分献上···
...全文
98 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
wsygbalzlbx 2011-07-28
  • 打赏
  • 举报
回复
帮顶帮顶帮顶帮顶帮顶
woshiliourun 2011-07-28
  • 打赏
  • 举报
回复
我的是前台一个 lbale接收的··
woshiliourun 2011-07-28
  • 打赏
  • 举报
回复
什么语法错误啊?? 能不能把正确的贴出来··
cumtmengmeng 2011-07-28
  • 打赏
  • 举报
回复
href=\"" + material.MPath.Replace("~", "..") + "\" target=\"_blank\"
有语法错误的
woshiliourun 2011-07-28
  • 打赏
  • 举报
回复
真的沉了···
woshiliourun 2011-07-28
  • 打赏
  • 举报
回复
woshiliourun 2011-07-28
  • 打赏
  • 举报
回复
自己先顶下··别沉了··
cx419075909 2011-07-28
  • 打赏
  • 举报
回复
刚那个是客户端的
cx419075909 2011-07-28
  • 打赏
  • 举报
回复
 
StringWriter sw =new StringWriter();
sw.WriteLine("Name \t Age");//第一行为姓名年龄
sw.WriteLine("Tom \t 15");//第二行

Response.AddHeader("Content-Disposition", "attachment; filename=" + strName);
Response.ContentType = "application/ms-excel";
Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
Response.Write(sw);
Response.End();


大致就这样子
woshiliourun 2011-07-28
  • 打赏
  • 举报
回复

110,538

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧