views:

398

answers:

1

I have a fairly complex Silverlight banner, with interstitials, hovers, active areas, etc. This is specced to work in Silverlight 1/2.

As I am an web standards fan, I'd like to accommodate users who do not have Silverlight and switch to an equivelant JavaScript-driven version of each banner if needed.

For expediency, I'd love to be able to do this server-side, so I can just show/hide an asp:Panel accordingly. This will let me test between Silerlight.non Silverlight environments easily as I can then just mock a non-SL capable experience.

Is there a way that will let me do this? I haven't noticed SL announce itself as part of the UserAgent, but we know we can't necassarily rely on that anyway. Am I restricted to relying on JavaScript and using that somehow to tell the server I need non-SL content?

A: 

IN ASP.NET / C# you can call the IsVersionSupported method

bool isSupported = host.IsVersionSupported("2.0.30908.0");

This should return false if the plugin is not installed.

Alternatively you can call the JS method either from the client, or the server depending on how you want it to work. The isInstalled method(s) are found in the Silverlight.JS file. JavaScript code: Silverlight.isInstalled(null);

PortageMonkey