如何使启用下载链接按钮上的文件单击..? [英] how to make enable download a file on LinkButton click..?

查看:99
本文介绍了如何使启用下载链接按钮上的文件单击..?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好...

我需要满足从站点下载文件的要求.该文件位于文件夹中,文件名位于数据库列中.如果用户单击文件名,则应该下载该文件.

谢谢..

hi to all...

I m in a requirement to meet that to download a file from a site. The file is in a folder and file name is in database column. If the user clicks on the name of the File, then that should get download.

thanks..

推荐答案

您可以从以下链接获取帮助

点击此处

将超链接更改为链接按钮,并在onclick事件中编写downloading.aspx
You can take the help from following link

Click here

Change thehyperlink to your linkbutton and onclick event write the code of downloading.aspx


link_button Click event
            {
                Response.BufferOutput = true;
                Response.Buffer = true;
                Response.AddHeader("Content-Disposition", "attachment;filename= " + SELECT FileName.ToString());
                Response.BinaryWrite((byte[])SELECT FILEBODY);
                Response.Flush();
                Response.End();
            }


http://delphi.about.com/cs/adptips2004/a/bltip0504_2.htm [ ^ ]
http://www.west-wind.com/weblog/posts/2007/May/21/Downloading-a-File-with-a-Save-As-Dialog-in-ASPNET[^]

http://delphi.about.com/cs/adptips2004/a/bltip0504_2.htm[^]


这篇关于如何使启用下载链接按钮上的文件单击..?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆