Skip Navigation LinksHome / Tips / View Tip

Tip: Avoid parameters without values in the object element

+ Add to SilverlightShow Favorites
0 comments   /   posted by Martin Mihaylov on Nov 28, 2008
(0 votes)
Categories: General , Controls and UI

When using the object element to display our Silverlight application, we can use parameters to configure it (source, onerror, background, minRuntimeVersion and etc.):

<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">
    <param name="source" value="ClientBin/Issues.xap"/>
    <param name="onerror" value="onSilverlightError" />
    <param name="background" value="white" />
    <param name="minRuntimeVersion" value="2.0.31005.0" />
    <param name="autoUpgrade" value="true" />
    <a href="http://go.microsoft.com/fwlink/?LinkID=124807" style="text-decoration: none;">
         <img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style: none"/>
    </a>
</object>

Some of them are predefined in the automatically created TestPages, but we can also add additional parameters like initParams, onload and etc.

Be sure always to set the value of each parameter, otherwise browsers different than Internet Explorer will not be able to render the object element properly and the "Install Silverlight" badge will appear instead of the Silverlight application. This issue could be a showstopper when embedding Silverlight applications into a web page and is not related to the Silverlight plug-in.

 

That's it!

Share


Comments

Comments RSS RSS
No comments

Add Comment

 
 

   
  
  
   
Please add 2 and 6 and type the answer here:

Join the free SilverlightShow webcast 'Running Silverlight Outside the Browser and with Elevated Trust'. Sept 7th, 8 am - 9 am PDT.
In this live session Chris Anderson will cover configuring and debugging OOB mode, toast notifications, elevated trust, direct file access and much more.
Learn more | Register | See more webinars (hide this)