托管后如何在Silverlight中打开pdf文件? [英] how to open a pdf file in silverlight after hosting?

查看:119
本文介绍了托管后如何在Silverlight中打开pdf文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的clientbin(silverlight)文件夹中有一个product.pdf,其中包含有关单击按钮的产品的详细信息,只是我想打开该pdf文件,我使用了以下代码,在托管HTTP报错后,该代码在本地运行良好404.0-找不到
您正在寻找的资源已被删除,名称已更改或暂时不可用.我该怎么办,请帮助我


**服务和Silverlight中的调用aspx页面**

I have a product.pdf in my clientbin(silverlight) folder which contains detail about product on click of button just i want to open that pdf i used following code it''s working fine locally after hosting it is giving HTTP Error 404.0 - Not Found
The resource you are looking for has been removed, had its name changed, or is temporarily unavailable. how can i do that one please help me


** service and calling aspx page in silverlight**

Dim uri As New Uri(HtmlPage.Document.DocumentUri, "/ClientBin/product.pdf")
      'HtmlPage.Window.Navigate(uri, "_blank")
      Dim path As String = uri.AbsoluteUri.ToString()
      ' HtmlPage.Window.Eval("window.open('" & path & "')")
      HtmlPage.Window.Eval("document.location.href='" & path & "';")




**托管后的错误代码**




** Error code After hosting **

HTTP Error 404.0 - Not Found
The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.

推荐答案

好吧,如果它告诉您找不到文件,则您构建Uri路径的代码是错误的.我会看看您发布的第一行代码.
Well, if it''s telling you the file cannot be found, your code to build the Uri path is wrong. I''d look at the very first line of code you posted.


这篇关于托管后如何在Silverlight中打开pdf文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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