Page view counter

Silverlight Tips of the Day - Blog by Mike Snow

Game Programming with Silverlight

Silverlight Tip of the Day #38 – How to Customize the Silverlight Install Experience

If a user visits your Silverlight site without Silverlight installed they will automatically see the following image:

image

While this is a clear message you may want to consider a better, more customizable experience for your web site that includes your web site branding, name, etc. For this purpose Silverlight provides an attribute off the Silverlight control in your ASPX site called PluginNotInstalledTemplate. Anything contained within this template will be displayed to the user instead of the standard “Install Microsoft Silverlight” image above.

For our demo, we will simply display an image and a FWLink which points to the most recent version of Silverlight.

When this demo page is accessed without Silverlight installed, you will see the following in your browser:

image

Now, let’s take a quick look to see how this is done.

<asp:Silverlight ID="Xaml1" runat="server" Source="~/ClientBin/SilverlightApplication29.xap"
    MinimumVersion="2.0.30523" Width="100%" Height="100%">
    <PluginNotInstalledTemplate>
        <div class="installSL">
            <div class="centerHV">
                <img src="stop.png" />
                <br />
                <br />
                <a href="http://go.microsoft.com/fwlink/?LinkID=115261"><font size="5" face="Verdana"
                    color="silver">http://go.microsoft.com/fwlink/?LinkID=115261</font></a>
            </div>
        </div>
    </PluginNotInstalledTemplate>
</asp:Silverlight>

As you can see from the code above, we simply place the content we want to show between the PluginNotInstalledTemplate tags of our Silverlight control.

We use a custom style in a <div> called installSL that is defined to keep the image centered, background black with the width and height of the div set to 100%:

<style>
    .installSL
    {
        background-color: Black;
        text-align: center;
        padding-top:50px;
        width: 100%;
        height: 100%;
    }
</style>

 

Thank you,
--Mike Snow

 Subscribe in a reader

Comments

Microsoft Weblogs said:

If a user visits your Silverlight site without Silverlight installed they will automatically see the

# September 10, 2008 1:50 PM

BenHayat said:

Mike, could you also provide us with JS code to keep checking the installation until the install is complete and then the app will start automatically in all browsers?

Thanks!

# September 10, 2008 4:51 PM

wisecarver said:

Very cool tip...Thanks.

# September 10, 2008 5:11 PM

2008 September 11 - Links for today « My (almost) Daily Links said:

Pingback from  2008 September 11 - Links for today &laquo; My (almost) Daily Links

# September 11, 2008 1:01 AM

Visual Web Developer Team Blog said:

&#160; Silverlight Tip of the&#160; Day #39 Title : How to Create a Zoom Toolbar. Demo: silverlight.services.live.com/.../iframe.html

# September 11, 2008 1:25 AM

Dew Drop - September 11, 2008 | Alvin Ashcraft's Morning Dew said:

Pingback from  Dew Drop - September 11, 2008 | Alvin Ashcraft's Morning Dew

# September 11, 2008 9:08 AM

Silverlight Installationsaufforderung at Blog von J??rgen Ebner said:

Pingback from  Silverlight Installationsaufforderung at Blog von J??rgen Ebner

# September 11, 2008 11:19 AM

Community Blogs said:

First today as a USArmy veteran (1970-1973), I think I would be remiss in not remembering 9-11-01. Roger

# September 11, 2008 3:14 PM

Mirrored Blogs said:

Post: Approved at: Sep-13-2008 NBC Did not dump Silverlight! There have been a bunch of posts lately

# September 13, 2008 4:34 AM

Silverlight 2 Webseiten Clean Up Check at Blog von J??rgen Ebner said:

Pingback from  Silverlight 2 Webseiten Clean Up Check at Blog von J??rgen Ebner

# November 18, 2008 1:58 AM

Silverlight Tips of the Day - Blog by Mike Snow said:

While exploring techniques for game programming with Silverlight I came across some hurdles and discovered

# November 18, 2008 1:27 PM

Silverlight Tips of the Day said:

While exploring techniques for game programming with Silverlight I came across some hurdles and discovered

# November 18, 2008 1:28 PM

Silverlight Tips of the Day - Blog by Mike Snow said:

While exploring techniques for game programming with Silverlight I came across some hurdles and discovered

# November 18, 2008 2:00 PM

Секреты Visual Studio said:

Когда создаешь новое приложение на Silverlight, необходимо проделать массу подготовительных операций.

# November 24, 2008 12:35 AM

Silverlight Tips of the Day - Blog by Mike Snow said:

The purpose of this post is to create an outline summary all the blogs from my Silverlight tips of the

# January 2, 2009 5:57 PM

o UAU nosso de cada dia said:

essa lista eu copiei desse blog bárbaro (acompanhe por RSS você também): uma lista de dicas super úteis

# January 3, 2009 6:25 AM

kkkkyue said:

good job,It's so cool

# March 13, 2009 2:37 AM