How to Programmatically detect Silverlight version?


Two questions that often arise when building Silverlight based websites are:

A. How do I detect if Silverlight is installed on a visitor’s browser?

B. How do I detect what version of Silverlight is installed on a visitor’s browser?

The answer to A is relatively simple since Silverlight.js (the standard Silverlight javaScript include file) contains a function that we can use. The function is called isInstalled and it returns true/false. You can use it the following way to detect if there is any Silverlight version installed:

<script src="Silverlight.js" type="text/javascript"></script>

var isSLInstalled = Silverlight.isInstalled(null)

The answer to B is a little more complex since for some reason there is no direct way to get Silverlight’s version number. Basically the only documented way to answer this question is to repeatedly call isInstalled with different version numbers until you get the right version.

Example:

Silverlight.isInstalled(‘3.0’)

Silverlight.isInstalled(‘2.0’)

Silverlight.isInstalled(‘1.0’)

Read Full article: click here

Related useful post: How to add Silverlight version detection to Google Analytics ??

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s