在新窗口中打开PDF [英] Open PDF in New Window

查看:118
本文介绍了在新窗口中打开PDF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我想通过JavaSctipt从背后的代码中单击按钮单击事件以在新窗口中打开PDF文件.

我正在使用下面提到的代码在新窗口中打开PDF文件.

Hello All,

I want to open PDF file in new window on button click event from code behind through JavaSctipt.

I am using below mentioned code for opening PDF file in new window.

string PopUpWindowPage = @"E:\\\Prism4.pdf";
string Script = "";
Script += "<script id='PopupWindow'>";
Script += "confirmWin = window.open(' " + PopUpWindowPage + "','" + 1 + "','scrollbars=yes,resizable=1, width=960,height=500,left=50,top=130,status');";

Script += "</script>";
if (!Page.IsClientScriptBlockRegistered("PopupWindow"))
          age.RegisterClientScriptBlock("PopupWindow", Script);


在新窗口中打开PDF文件时,出现以下错误消息.


I get below mentioned error message while opening the PDF file in new window.

Microsoft JScript runtime error: Access is denied.


有人可以告诉我上述代码或任何其他设置有什么问题吗?

感谢Adv ...


Can Anyone tell me whats the issue with above code or any other settings have to do?

Thanks in Adv...

推荐答案

我怀疑您正在运行的asp.net帐户无权访问e:\驱动器的内容.

一种简单的测试方法是移动PDF文件,使它位于asp.net项目的示例文件夹中,并查看是否可以从其中读取它.
I suspect that the asp.net account you are running under does not have permission to access the contents of the e:\ drive.

A simple way to test this is to move your PDF file, so that it sits in the sample folder as you asp.net project and see if it can be read from there.


这篇关于在新窗口中打开PDF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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