Quantcast
Channel: Ramani Sandeep's Blog » WPF / Silverlight
Viewing all articles
Browse latest Browse all 8

How to Programmatically detect Silverlight version?

$
0
0

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 ??


Posted in WPF / Silverlight

Viewing all articles
Browse latest Browse all 8

Trending Articles