开发者

How to add IFRAME in SilverLight?

开发者 https://www.devze.com 2023-02-17 15:15 出处:网络
H开发者_Python百科ow do I add IFrame in a Silverlight 4.0 User control ? And I want a button on the control that refreshes the IFrame.Is that possible?To render HTML on top of silverlight, you have t

H开发者_Python百科ow do I add IFrame in a Silverlight 4.0 User control ?

And I want a button on the control that refreshes the IFrame. Is that possible?


To render HTML on top of silverlight, you have to use WindowLess mode. This is a configuration in the object tag. Then you'll need to manually program your IFrame to float in the correct location using javascript or the bridge provided by Silverlight. You can use a commercial control like Robaticus suggested or figure it out on your own.

Either way, none of these options work for Mac. So if you're developing for Windows only, then you're ok. Anyone using Mac will not see any HTML float on top of Silverlight.


If you absolutely want an IFrame in the HTML page (contrary to what the other answers suggest) you could obtain access to the IFrame in Silverlight by using the HTML Bridge


I think you can use WebBrowser class to display IFrame content in Silverlight. Or check this link it will also help you. - How to use iFrame tag in XAML Silverlight 4?


The iframe tag is HTML, not Silverlight. If you have an out-of-browser Silverlight application, you could potentially use the WebBrowser control, but this is not available for in-browser applications.

There is an approach out there where you can essentially make a DIV on your hosting page appear overtop of your Silverlight application, but, in my experience, this is very hard to control, and the visual results are less-than-ideal.

Additionally, there are a few commercial components that do HTML rendering, but they all seem to use the same approach of a floating DIV, and they are not as reliable as I would like to see them.

0

精彩评论

暂无评论...
验证码 换一张
取 消