Wednesday, August 18, 2010

Display Silverlight in SharePoint Content Editor Webpart


The steps:
  1. Created a web part page document library
  2. Uploaded xap into the library
  3. Create a new web part page in the library
  4. Added a content editor web part to the page.
  5. Added an object tag pointing to the XAP file in the source code of the content editor web part

And, voila.... nothing displayed! Played with adding the Silverlight.js file to the library, and various other techniques. Finally found the key was the interaction of the object tag width and height with the rendered dimensions of the web part.

Solved by either:

  • Setting a fixed height and width in the web part appearance properties, and giving the object tag a height and width of 100%, OR
  • Setting an absolute height and width for the object tag and leaving the web part with non-fixed height and width

No comments:

Post a Comment