IE8, Silverlight and Disappearing Page Content

A little while ago I wanted to add support for Silverlight content to the wonderful Umbraco content management system. Quite an adventure (templates, xslts, …) and while on the road I ran into a nasty thing that kept me guessing for hours.

Silverlight showed up on my page but everything below it was not rendered in IE8. Using F12 in the browser confirmed the fact that the content was really there but it just didn’t show. Again, F12 to the rescue, searching for secret, hidden styles that were obfuscating the content did not give any information.

So I copied all HTML (from the browser) to Visual Studio and started to strip it down to find the problem. And there is was:

<iframe id="_sl_historyFrame" 

    style="visibility:hidden;height:0px;width:0px;border:0px"/>

By simply changing this to:

<iframe id="_sl_historyFrame"

    style="visibility:hidden;height:0px;width:0px;border:0px"></iframe>

everything was OK again.

The silly thing, as with any html problem, is that only when you’ve found out what was wrong you’re able to Bing for the problem/solution…