Silverlight & SharePoint 2007

“It’s just an object tag”

One of the things that was in focus during the Las Vegas SharePoint Conference 2009 was Silverlight in Sharepoint 2010. But you don’t need SharePoint 2010 to enjoy this, its easy to do the same in SharePoint 2007. As it states above, Silverlight in SharePoint is just an object tag; there are no requirements and no need to install or configure anything extra.

In its most basic form, all you need is:

<object width="300" height="300"    data="data:application/x-silverlight-2,"     type="application/x-silverlight-2" >    <param name="source" value="SilverlightApplication1.xap"/></object>

Just upload the .XAP file to a SharePoint document library and set the value of the source parameter to the URL.

If you need to pass startup values to your Silverlight application you add a initparams parameter with key/value pairs (comma separated):

   1: <param name="initParams" value="param1=value1"/>

And you retrieve them like so:

var value1 = Application.Current.Host.InitParams["param1"];

Now, to actually read and write data from SharePoint, you’ll need to use SharePoint’s web services. This is where SharePoint 2010 provides a brand new client object model that gives you this ability, but its easy enough to do this yourself.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: