This is done automatically for you when you create a new Silverlight Application.
You can get more detail on exactly the mechanism that Microsoft uses to do this by creating a new Silverlight Application in Visual Studio and choose to create a Web application to host the Silverlight application. In the root of this Web application you will see a Silverlight.js file, look at the isInstalled function. This file is filled with examples to do pretty much anything you would like to do custom. But under normal circumstances you do not need to do a thing as Microsoft already took care of that. or check here http://msdn.microsoft.com/en-us/library/system.windows.interop.silverlighthost.isversionsupported(VS.95).aspx On Fri, Jul 17, 2009 at 4:12 AM, sa <[email protected]> wrote: > > Hi, > > I am using ASP.NET 3.5 with C#. I need to write a code that will help > me detect if Microsoft's Silverlight is installed on the clients > browser or not. Is it is not installed I display a NoSilverLight.aspx > page. If it is installed I dispaly a mySilverlight.aspx page. > > I have done it in 2 ways and none of them are working > -------------------------------------------------------------------- > > Method 1: > > <div id="silverlightControlHost"> > <script type="text/javascript"> > if (Silverlight.available) //true silverlight installed > { > document.write("Silverlight is available!"); > > } > else { > document.write("Silverlight is NOT available!"); > > } > </script> > </div> > > ------------------------------------------------------------------------------------------------------------------------- > Method 2: > <script src="Intel.ARK.Silverlight1_0.Controls.Client.Silverlight.js" > type="text/javascript"></script> > > var = Silverlight.isInstalled(null) > if ( Silverlight.isInstalled(null) ) > { > document.write("Silverlight is available!"); } > -- Regards Jay Dan
