在Silverlight中将iframe放置在子窗口中的问题 [英] Problems with placing a iframe inside a child window in silverlight

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

问题描述

hi ..

我以编程方式在我的Silver-light应用程序的子窗口中创建了一个iframe.
现在,我尝试调用我的子窗口,并将其打开为空.
iframe未加载.

以下是我的代码:

hi..

i pro-grammatically created a iframe in my child window of silver-light application.
now i try to call my child window and its open with empty.
the iframe is not loading.

below is my code:

System.Windows.Browser.HtmlElement iframe;
iframe = HtmlPage.Document.CreateElement("iframe");
iframe.Id = "invisibleIframe";
iframe.SetProperty("src", "http://ilabs.uw.edu/sites/default/files/sample_0.pdf");
iframe.SetStyleAttribute("width", "800");
iframe.SetStyleAttribute("height", "600");
iframe.SetAttribute("onload", "contentLoaded"); // call a function which calls silverlight.Content.Page.Loaded() 
HtmlElement body = (HtmlElement)HtmlPage.Document.GetElementsByTagName("body")[0];
body.AppendChild(iframe);


如何解决这个问题..
需要您的建议..

问候
gopal.s


how to tackle this issue..
need ur suggestions..

regards
gopal.s

推荐答案

您好,mmmm ...我认为您的方案是不可能的.

在调查您的问题时,我发现这篇非常有用的文章 http://msdn.microsoft .com/en-us/library/cc221359(v = vs.95).aspx [此 [< ^ ]或使用Silverlight的网络浏览器控件:)

在您的代码中,我看到您想显示pdf,所以我给您一些解决方案以显示它们:
http://silverlightpdf.codeplex.com/ [ ^ ]

http://www.amyuni.com/en/developer/pdfsilverlight/ [ http://dotnetslackers.com/articles/aspnet/WatermarkingPDFDocumentsUsingHttpHandlers.aspx [
Hi there, mmmm... I think that your scenario is not possible.

Investigating about your question I found this very useful article http://msdn.microsoft.com/en-us/library/cc221359(v=vs.95).aspx[^]

In your case, you can put the iframe on your aspx page and call it using a third party control like this[^] or using the webbrowser control of silverlight :)

In your code I see that you want to show a pdf, so I give you some solutions to show them:
http://silverlightpdf.codeplex.com/[^]

http://www.amyuni.com/en/developer/pdfsilverlight/[^]

http://dotnetslackers.com/articles/aspnet/WatermarkingPDFDocumentsUsingHttpHandlers.aspx[^] Use this with your code above ;)

Hope it helps in any way


这篇关于在Silverlight中将iframe放置在子窗口中的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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