Some of the users who reach your test page will not have Silverlight installed, or they won't have the correct version. The standard behavior is for the Silverlight test page to detect the problem and notify the user. However, this may not be enought to get the user to take the correct action.
For example, consider a user who arrives at your website for the first time and sees a unfamiliar program, confused about why it's needed, and intimidated by the installation asking them to download the Silverlight installation pack-age and then run an executable. At any point, they might get second thoughts and surf somewhere else.
To give your users a friendlier install experience, begin by customizing the alternative content. As you learned in the previous section, if the user doesn't have any version of Silverlight installed, the browser shows the Silverlight badge——essentially, a small banner with a logo and a Get Silverlight button. This indicator is obvious to developers but has little meaning to end users. To make it more relevant, add a custom graphic that clearly has the name and logo of your application, include some text underneath that explaining that the Silverlight plug-in is required to power your application and then include the download button.
The second area to address is versioning issues. If the user has Silverlight, but it doesn't meet the minimum version requirement, the alternative content isn't shown. Instead, the Silverlight plug-in triggers the onError event with args. ErrorCode set to 8001(upgrade requried) or 8002(restart required) and then displays a dialog box prompting the user to get the updated version. A better, clearer approach is to handle this problem yourself.
First, disable the automatic upgrading process by setting the autoUpgrade parameter to false:
Then, check for the version error code in the onSilverlightError function in the test page. If you detect a version problem, you can then use JavaScript to alter the content of the <div> element that holds the Silverlight plug-in. Swap in a more meaningful graphic that clearly advertises your application, along with the download link for the correct version of Silverlight.
To test your code, just set the minRuntimeVersion parameter absurdly high: