Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/wix/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何在ASP.net web应用程序中显示pdf文件?_C#_Asp.net_.net_Web - Fatal编程技术网

C# 如何在ASP.net web应用程序中显示pdf文件?

C# 如何在ASP.net web应用程序中显示pdf文件?,c#,asp.net,.net,web,C#,Asp.net,.net,Web,我想单击我的链接按钮并打开该项目的pdf文件。 我该怎么做 在aspx页面中: 在cs页面中: 私有无效pdfShow_Click(){ ///请帮帮忙。 }试试这个,它更简单 Response.Clear() 请对你的建议作出澄清answer@Wais请编辑现有文件,而不是创建新文件。pdf文件的路径是什么,如~/123.pdfw您在哪里存储pdf文件系统或数据库? string filePath = ur file path on the server like ~/123.pdf Re

我想单击我的链接按钮并打开该项目的pdf文件。 我该怎么做

在aspx页面中:

在cs页面中: 私有无效pdfShow_Click(){

///请帮帮忙。 }

试试这个,它更简单 Response.Clear()


请对你的建议作出澄清answer@Wais请编辑现有文件,而不是创建新文件。pdf文件的路径是什么,如~/123.pdfw您在哪里存储pdf文件系统或数据库?
string filePath = ur file path on the server like ~/123.pdf

Response.contentType = "application/pdf";

Response.WriteFile(filePath);