How to Embed Silverlight Content in Almost Any Web Page


Catherine Heller has written up a great post that describes a new feature in Silverlight Streaming. Having uploaded a Silverlight application to the Silverlight Streaming service, you can now embed it in any web page as an <iframe>.


If you want to include a cool Silverlight gadget on your blog, but your blog engine doesn’t support custom scripts or XAML files, this will work well. It’s also perfect for a social networking site like Facebook, since you can create an application that hosts an <iframe>.


Here’s a little example that demonstrates this:


All it took to embed this was one element:

<iframe src=”http://silverlight.services.live.com/invoke/32/SlLogo/iframe.html” 
frameborder=”0″ width=”258″ height=”100″ scrolling=”no” />

Of course, you’re welcome to steal this one-liner to add some Silverlight “bling” to your own site 🙂


In the next post, I’ll walk through a step-by-step guide to uploading an Expression Blend project to Silverlight Streaming.

Comments (25)

  1. Tim Sneath からです。 How to Embed Silverlight Content in Almost Any Web Page Silverlight を作成した後、それを直接 Web

  2. Tim great little snippet to help us get a little Silverlight love on our blogs.  Maybe we can get a transparent one so that it doesn’t look so bad on non-white blogs :).

    As I pointed out in my post http://www.brockett.net/?p=204 it’s all about getting Silverlight down to the client machine and "blog bling" and small little web apps is a great way to spread the platform.

  3. You’ve been kicked (a good thing) – Trackback from DotNetKicks.com

  4. Michael Sync says:

    Silverlight is only for UI and graphics design? Can it be used for normal web application system? The most of example that I found on internet are for designing things and how to make UI look good. I didn’t see any example about manipulating with database.

    I’m very new in Silverlight and still learning.. I think that it’s very interesting…. might be better than flash..

  5. WynApse says:

    Silverlight Cream for August 1, 2007

  6. i have plugged in Homer Simpson as Silverlight in weblogs.asp.net page.

    You need all scripts inline and the xaml as text/xaml script

  7. Harlequin says:

    To answer Michael Sync, yeah, it’s much more than UI. There are tons of resources that are non-UI for Silverlight.

    As for the iframe, this doesn’t work on older browsers like Netscape 4 and such, will it? I didn’t think the <iframe> element was widely implemented into non-IE browsers until a few years ago, even though it was in the standards of the day.

    And the "don’t worry about older browsers" cannot be an excuse, because not everyone of the 4 billion computers out there is a top of the line Dell, some are older computers because that’s all people can afford.

  8. Morten says:

    I’m having problems getting this to work in my WordPress blog. I’m guessing it’s because WordPress parses iFrames incorrectly but I’m not entirely sure. You can read more about it here: http://blog.pinkandyellow.com/silverlight/silverlight-posting-test-20070808/

    If anyone has any more luck than me doing this I’d much appreciate the help.

    mor10

  9. Morten says:

    Please disregard my earlier comment. Turns out the reason why the code above doesn’t work in WordPress is because WordPress needs a proper close to the <iframe> command. If you try the shorthand /> WordPress will insert an </iframe> right after the src call leaving the rest of the code out in the cold. This causes massive problems.

    lesson learned.

  10. So does this mean I can’t just include a script from another domain?

  11. Zach Coelius says:

    Very cool.  We are super excited about silverlight at Triggit. Can’t wait to see all the cool stuff people build

  12. Tim Sneath : How to Embed Silverlight Content in Almost Any Web Page &lt;iframe src="http://silverlight.services.live.com/invoke/32/SlLogo/iframe.html&quot;

  13. 以前 Tim Sneath のブログ で紹介されていましたが、Windows Live の Silverlight Streaming サービス を利用すると、通常の HTML に iframe を使ってSiverlight

  14. 以前 Tim Sneath のブログ で紹介されていましたが、Windows Live の Silverlight Streaming サービス を利用すると、通常の HTML に iframe を使ってSiverlight

  15. barlog says:

    さて RIA 展開の柱 Flash に .NET , VS 側からアプローチする Microsoft Silverlight 1.0 Final のアナウンスが…

  16. This is quite handy when trying to embed silverlight in a site when having no access to code, etc.

    For using this in your normal website isn’t very efficient.

    Wherefore we created a .NET control for use in our own sites. See here: http://web-snippets.blogspot.com/2007/09/embedding-silverlight-using-net-control.html

  17. via Tim Sneath: How to Embed Silverlight Content in Almost Any Web Page

  18. Over at Remy’s space he’s posted a collection of screenshots of the Silverlight applications being delivered

  19. &#160; This is a simple, and completely unofficial, inventory of many cool Silverlight applications…

  20. This is a simple, and completely unofficial, inventory of many cool Silverlight applications that use…

  21. This is a simple, and completely unofficial, inventory of many cool Silverlight applications that use…

  22. This is a simple, and completely unofficial, inventory of many cool Silverlight applications that use…

  23. I have been meaning to start video blogging (vlogging) for some time. I think you can get stuff across