This is a mirror of official site: http://jasper-net.blogspot.com/

Configuring the Silverlight plugin

| Tuesday, May 3, 2011
Silverlight applications run within the context of a web page. On this page, an HTML OBJECT tag is embedded which contains a reference to the Silverlight XAP file, normally within the ClientBin directory. Using parameters (params) in the OBJECT tag, we have a communication channel that allows sending values from the HTML to the Silverlight application: in most cases, we can use known parameter names to both set up the Silverlight application the way we want and secondly pass parameter values to Silverlight.

In this tip, we’ll look at the several options we have to configure the Silverlight plugin from the HTML OBJECT tag. The code for this sample can be downloaded here.

The defaults

When creating a new Silverlight application in Visual Studio 2010, both an *.aspx and a *.html file are created. In “early” versions of Silverlight, the *.aspx page contained the asp:Silverlight control, which was a server-side control to setup a Silverlight application. This control isn’t used anymore, so both files use the above mentioned OBJECT tag. The default-generated code is shown here:

 
<form id="form1" runat="server" style="height:100%">
    <div id="silverlightControlHost">
       
            type="application/x-silverlight-2" width="100%" height="100%">
           
           
           
           
           
                style="text-decoration:none">
                Get Microsoft Silverlight
           
       
        <iframe id="_sl_historyFrame" 
            style="visibility:hidden;height:0px;width:0px;border:0px">
        </iframe>
    </div>
</form>
 

Let’s now look at how we can use this to configure how the plugin will show the Silverlight application.

Read more: Silverlight show

Posted via email from Jasper-net

0 comments: