U2U Blog

for developers and other creative minds

Week in Prague

This week was a great one here in Prague with 20 students most of them already up to speed with all of the SharePoint development topics and eager to learn more. A good example of the SharePoint work done here is this Internet site done with MOSS 2007. http://new.skoda-auto.com/COM/Pages/Home.aspx

From what I have seen, Prague is a wonderful city that I definitely want to visit more but then without business on my mind. Thanks to Tomas (and Katka) for the organization and for the entertainment yesterday. The Czech beer was great and this trip definitely is categorized as one of the best ones so far this year. Thanks guys and good luck in the world of SharePoint.

The InitParameters Property of the SilverlightControl

When using Silverlight from within SharePoint you have to place a SilverlightControl on your web part, custom field type or application page. By setting the Source property you indicate which Silverlight application to run.

You can use the InitParameters property to pass values from SharePoint to Silverlight. But there is something weird about this property: at the Server side this property is a string and at the Silverlight side this property is a dictionary of KeyValuePairs where the value is always a string.

To construct the string so that it can easily be converted to a dictionary of KeyValuePairs by Silverlight you have to separate the different parameters by a comma and you have to place an equal sign between key and value:

silverlightControl.InitParameters = "key1=value1,key2=value2,key3=value3";

Don't place a blank between the comma and the next key because it will be added as the first character in the next key name.

In the App.xaml code behind you can then retrieve the keys and values from the EventArgs argument:

string value1 = null;

string value2 = null;

if (e.IniParams != null && e.InitParams.Count > 0)


value1 = e.IniParams["key1"];

value2 = e.IniParams["key2"];


If you need these values in your code behind of your xaml pages, pass them within the constructor of the page:

this.RootVisual = new Page(value1, value2);

Be aware that you cannot pass large chunks of data in the InitParameters property.

How to configure your SharePoint extended IIS Web App for working with Silverlight 2 applications

There were a number of questions on the blog or per email regarding the configuration of the web.config in a SharePoint IIS Web app in order for the Silverlight BluePrint samples to work. Not that much though and that is of course a good sign. As I understand from it, many people are up-and-running with the samples.

UPDATE: Before you deploy your Silverlight XAPs, please recompile them using Visual Studio 2008. That should solve the problems a number of you have with the blank Web Part. 

Here is a checklist for the things you need to do:

  1. Of course, you need to download the Silverlight 2 plug-in. This can be done from here.
  2. Have service pack 1 installed for WSS 3.0 or service pack 1 for MOSS 2007. This adds support for what you're going to do with AJAX and Silverlight 2. Note that a number of the samples assume you have a publishing site up and running and therefore work only in a MOSS 2007 scenario.
  3. You'll need .NET 3.5 on your server. The System.Web.Extensions.dll is required server-side. The redistributable .NET 3.5 framework can be downloaded from here.
  4. The .NET 3.5 framework must be extended with the System.Web.Silverlight.dll. This DLL is part of the Microsoft Silverlight 2 Software Development Kit Beta 1 and if you only download this, you'll have to make sure that the System.Web.Silverlight.dll is available as an assembly in the Global Assembly Cache (GAC).
  5. For the development of Silverlight 2 applications, you'll work in Visual Studio 2008 extended with the Microsoft Silverlight Tools Beta 1 for Visual Studio 2008. Note that by installing these tools, you'll also install the required runtime and the SDK, and you should have all of the DLL's in place to get the Silverlight 2 applications delivered server-side.
  6. You need all of the .NET 3.5 (AJAX) + Silverlight configurations in the web.config. A good approach is to create in Visual Studio 2008 a Silverlight application project with a Web site to test out the XAML. The Web site includes a web.config that is ready and that contains the sections you have to copy to the web.config of the IIS Web application that hosts your SharePoint sites on which you want to try out the BluePrint samples. On the plane going back home from the conference in Seattle, I have made a screencast that illustrates this. It explains all of the steps. Download the zip containing it from here.
  7. Last but also important thing (also illustrated in the screencast) is that you have to register the .xap extension as a MIME type (application/x-silverlight-2-b1) for the IIS Web application. Don't forget that one!

I have the web.config used within the screencast available for download here in case you want to check the configurations. 

How to configure your SharePoint extended IIS Web App for working with Silverlight 2 applications

It has been a week now since the Silverlight BluePrint for SharePoint has been released. We already had a lot of positive feedback but also some reactions of confused developers not getting the configuration settings right.

Patrick has an excellent post on how you have to configure your SharePoint web applications to get them ready for Silverlight. Please check out his post and take the time to watch his screencast. You will not be disappointed!

Inside Search Book in Print

Friday evening, the Inside Index and Search Engines: MOSS 2007 MSPress book was handed off for print. This means that it will be in the shops very soon - April 2th is the official date. Many thanks to the MSPress team who again did a marvelous job.

And while you are searching for more books. Andrew Connell also finished his work on the forthcoming Web Content Management book. I reviewed chapters of it and it is excellent material. Go and pre-order it!

Silverlight BluePrint for SharePoint back alive!

I'll spare you the details but we are back alive with the downloads for the BluePrint. Before you get started download the beta 1 from this place: http://www.microsoft.com/silverlight/resources/installationFiles.aspx?v=2.0. And don't forget to have a read through the SDK.

Before the samples will run on your SharePoint enabled IIS Web applications, you have to register the XAP extension as a new MIME type (application/x-silverlight-2-b1). Don't forget that one!

I am going to regret what I am writing now, but in exchange for a beer, I'll be available for help if you needed with the samples. Drop me an email: patrick@u2u.be and I'll see what I can do for ya.

Now off to the conference again...

Oh btw, we'll update the download packages shortly to reflect the name change that occured the very recently. No worries if you are downloading the stuff now. I just made sure that all is now displayed as Silverlight BluePrint for SharePoint and not the reverse.