如何在链接按钮上下载pdf文件点击asp.net? [英] how to download a pdf file on link button click in asp.net?

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

问题描述

嗨。



当用户点击链接按钮时,他可以将pdf文件下载到本地系统。

如何使用asp.net使用C#执行此操作。



先谢谢

Hi.

when user clicks on link button ,he is able to download a pdf file into local system.
how to do this using asp.net using C#.

Thanks in Advance

推荐答案

最简单的方法是制作pdf文件的超链接。然后,当用户点击它时,浏览器将自动下载它。



另一种方法是将字节写入Response对象。其中一个例子就是文件下载ASP.NET和跟踪下载成功/失败的状态 [ ^ ]
The easiest way is to make a hyperlink to the pdf file. Then when the user clicks it the browser will automatically download it.

The other way is to write the bytes to the Response object. One example of that is here, File Download in ASP.NET and Tracking the Status of Success/Failure of Download[^]


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

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