I'll be using this page to link to Silverlight 2 articles and posts (both ones I write as well ones by others).  Check back often for updates as I'm just getting started.

Getting Started Tutorials

  • Silverlight 2 End to End Tutorial: Digg Sample: I recommend reading this post first if you are looking to get started with Silverlight 2 development for the first time.  It not only describes the high-level of what Silverlight 2 provides, but also links to a series of 8 blog posts that walkthrough building a Digg client sample application.  These tutorial posts provide a good introduction to Silverlight 2 and WPF development concepts. 

  • First Look at Using Expression Blend with Silverlight 2: I recommend downloading the Expression Blend 2.5 March preview and following along with this tutorial post.  I think it does a good job of showing off some of the common features of Expression Blend, and uses it to build an IM chat client sample.

  • Jesse Liberty Silverlight Tutorials: Jesse Liberty is writing an in-depth series of articles that cover Silverlight programming concepts in more depth.  Bookmark this page and check back frequently to read them as they get published (he also has PDF versions of each article that you can download and read offline).

Getting Started Presentations

  • My Getting Started with Silverlight Talk: You can download the slides + samples from my "Getting Started with Silverlight 2" talk that I recently gave in Arizona.  Feel free to re-use the slides however you want for your own presentations.

Documentation Links

Tutorials and Samples

  • Using Deep Zoom with Silverlight 2: Jacek Ciereszko has a nice blog post that describes how to use the "Deep Zoom" feature of Silverlight 2 to implement image zoom functionality like with the Hard Rock sample.

Deployment

User Controls

ListBox and ScrollViewer

DataGrid

  • Using Silverlight 2's DataGrid with WCF + LINQ to SQL: This 15 minute video blog demonstrates how to build a LINQ to SQL object model on the server and publish it using WCF.  It then demonstrates how to build a Silverlight client that uses the new Silverlight DataGrid control, and which calls the WCF service to retrieve the LINQ to SQL data to populate it with.

  • Simple Editing of Web Service Data in a DataGrid: Mike Taulty has a nice blog post that shows how to create a WCF service on the server, and then use it from a Silverlight 2 client to retrieve data, bind it to a DataGrid, allow users to update rows, add/delete rows, and then save it back to the server using Silverlight 2 Beta1.

  • Sorting with Silverlight 2's DataGrid Control: The DataGrid control in Silverlight 2 Beta1 doesn't yet have built-in column sorting support (it is coming in Beta2).  That hasn't stopped Matt Berseth though!  In this post he shows how to implement sorting using a custom header column approach.  Also check out Matt's post here, which provides a DataGrid test page that shows off a number of the current DataGrid features.

Control Templates

Web Services and Networking

  • Web Services and Silverlight: This helpful post discusses how to use web-services with Silverlight and links to relevant quickstart samples and documentation.

HTML Integration

  • Silverlight Interop with HTML: Wilco Bauwer has a great post on the HTML and JavaScript integration features enabled by Silverlight 2 (he should know all about them - since he was the developer who built them!).

Unit Testing

  • Unit Testing with Silverlight 2: This post of mine talks about how to unit-test Silverlight 2 applications using the unit test framework in the Silverlight SDK.

Video Scenarios

Accessibility and 508 Compliance

  • Accessibility in Silverlight 2: Mark Rideout from the Silverlight team talks about accessibility support with Silverlight 2, and talks about how you'll be able to build section 508 and accessible solutions using Silverlight.


ASP.NET Web Application Projects

The Web Application Projects add-in provides a Visual Studio 2005 Web project model that will serve as the standard for .NET applications development. The new model will replace the existing Web Site model.
Adding Web application projects to Visual Studio 2005 requires you to install both an update and an add-on to Visual Studio 2005. The two installations perform the following tasks: The next service pack released for Visual Studio 2005 should contain the update and add-in, however, until that time these require a manual installation.
For additional information, refer to the Knowledge Base article on MSDN: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvs05/html/wap.asp.

Project templates

Two project templates have been created and are available for developers to download and use with Visual Studio 2005. The templates provide the basic Web application project configuration for the presentation and business tiers, and eliminates the majority of the start-up coding necessary to begin developing an application.
While the project templates contain much of the code outlined in the Application Configuration section, it is recommended that you read the section in its entirity to understand the logic and reasoning behind the choices made.
To add the project templates to Visual Studio 2005, complete the following steps:
  1. On the Visual Studio 2005 toolbar, click on Tools
  2. Select Options...
  3. Click on Projects and Solutions
  4. In the box below Visual studio user project templates location: enter \\dotnettest01\ProjectTemplates
  5. Click on OK
Once the project templates have been added to Visual Studio 2005, create the presentation and business tiers for your Web application project using the following steps:
  1. Select File > New > Project...
  2. Under the Project types listing on the left, select Visual C#
  3. Click on UCS - ASP.NET Web Application under the My Templates heading
  4. Name the presentation tier using the Pascal capitalization standard
    For example: AdminConsole
  5. Click on OK
  6. After creating the presentation tier, add the business tier by right clicking on the solution name and select Add > New Project...
  7. Click on UCS - Class library under the My Templates heading
  8. Name the business tier using the Pascal capitalization and Uppercase standards
    For example: BSU.UCS.AdminConsole
  9. Click on OK
  10. Note: The presentation tier contains an invalid reference to the BSU.UCS.ASPDotNetTemplate project. You will need to remove this reference and add a new project reference to the class library you created in the step above.
Using these standards will create the necessary folder structure needed to follow the Microsoft Visual SourceSafe naming conventions.
There are several benefits gained by using the aforementioned project templates. First, the templates are stored in a common area available to all developersWhen a new template is deployed to the server by copying the ZIP file to the share, all developers immediately have access to it from within Visual Studio. After the initial deployment, changes to the template can be made in one place instead of having to be deployed to each developer's workstation.
In addition, because the template is used as a true template, it remains unchanged and can be used repeatedly to create new projects. This is a vast improvement over the old "copy and paste" approach where one developer would create a file or project and hand it off to another. Without careful management, the original was quickly lost and modified with no chance to get back to a known good configuration.


If you read this blog you probably know that besides the web user interface, SharePoint also exposes some interfaces which you can use from code: the SharePoint object model and the SharePoint web services. The object model of SharePoint can only be used by code/applications that are running on a SharePoint server in your Server Farm, so you can’t use the object model on client machines. The SharePoint web services can be used of course across a network boundary, that’s what they are built for! In this post I’m going to show you how you can access the out-of-the-box SharePoint web services by making use of the jQuery Javascript library. First let’s see what you can do with this technique: download this zip file that contains an ASPX page (a basic Site Page without any code behind), and the jQuery Javascript library (in case you don’t have it already). Upload the two individual files (not the zip file) in the root of a Document Library in any of your SharePoint sites. You can do this by making use of the web user interface; you don’t have to touch anything on the server itself. When done, just click on the link of the uploaded ASPX and you’ll see following page:


 
Probably you’re not really impressed but think about the fact that this page is just an ASPX file you’ve uploaded through the web user interface, there is absolutely no code behind involved (which would have been blocked by SharePoint’s default security settings). The details of the SharePoint lists are loaded by making use of Javascript code that calls the web SharePoint lists.asmx web service.

So how do you call a SharePoint web service in Javascript code; well you can use the XmlHttpRequest object and write lots of boring code, or you can make use of a Javascript library that wraps this XmlHttpRequest object and exposes a nice and easy interface. In this demo I’ll use the jQuery Javascript library, so the first thing that you’ll need to do is to make sure the page is loading that library:

<script type="text/javascript" src="jquery-1.3.2.min.js" mce_src="jquery-1.3.2.min.js"></script>

If you already configured your SharePoint site so the jQuery library is loaded (for example by making use of the SmartTools.jQuery component), you can skip this line of course. 

When the page is loaded, the Lists web service (e.g. http://yoursite/_vti_bin/lists.asmx) of SharePoint needs to be called; this can be accomplished by making use of the jQuery’s ajax method. This method can post the necessary SOAP envelope message to the Lists web service. The XML of the SOAP envelope can easily be copied from the .NET web service test form of the desired web method (e.g. http://yoursite/_vti_bin/lists.asmx?op=GetListCollection). In the code below, a call to the GetListCollection web method is made when the page is loaded. The complete parameter of the ajax method is actually a pointer to another Javascript function (which we’ll implement later on) that will be called asynchronously when the web service call is done.  Don’t forget to update the url parameter with your SharePoint site’s URL!

$(document).ready(function() {
    var soapEnv =
        "<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'> \
            <soapenv:Body> \
                <GetListCollection xmlns='http://schemas.microsoft.com/sharepoint/soap/'> \
                </GetListCollection> \
            </soapenv:Body> \
        </soapenv:Envelope>";

    $.ajax({
        url: "
http://yoursite/_vti_bin/lists.asmx",
        type: "POST",
        dataType: "xml",
        data: soapEnv,
        complete: processResult,
        contentType: "text/xml; charset=\"utf-8\""
    });
});

As I already mentioned, the processResult function is called when the response XML of the web service call is received. In this method a loop is created which will iterate over every List element of the response XML. For every List element a <li></li> element is added to the element with the ID attribute set to data.

function processResult(xData, status) {
    $(xData.responseXML).find("List").each(function() {
        $("#data").append("<li>" + $(this).attr("Title") + "</li>");
    });
}

This data element is the actual <ul></ul> list in HTML:

<ul id="data"></ul>

When you put everything together in a Site Page, this is the result:


 
In the zip file mentioned in the beginning of this post, you can find an extended version of the processResult function which will display some additional metadata for every list (like the ID, ItemCount etc). The entire contents of basic version of the Site Page built in this post goes as follows:

<%@ Page Language="C#" MasterPageFile="~masterurl/default.master" %>

<asp:Content runat="server" ContentPlaceHolderID="PlaceHolderAdditionalPageHead">

    <script type="text/javascript" src="jquery-1.3.2.min.js" mce_src="jquery-1.3.2.min.js"></script>

    <script type="text/javascript">
        $(document).ready(function() {
            var soapEnv =
                "<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'> \
                    <soapenv:Body> \
                        <GetListCollection xmlns='http://schemas.microsoft.com/sharepoint/soap/'> \
                        </GetListCollection> \
                    </soapenv:Body> \
                </soapenv:Envelope>";

            $.ajax({
                url: "
http://yoursite/_vti_bin/lists.asmx",
                type: "POST",
                dataType: "xml",
                data: soapEnv,
                complete: processResult,
                contentType: "text/xml; charset=\"utf-8\""
            });

        });

        function processResult(xData, status) {
            $(xData.responseXML).find("List").each(function() {
                $("#data").append("<li>" + $(this).attr("Title") + "</li>");
            });
        }
    </script>

</asp:Content>
<asp:Content runat="server" ContentPlaceHolderID="PlaceHolderMain">
    <ul id="data"></ul>
</asp:Content>
<asp:Content runat="server" ContentPlaceHolderID="PlaceHolderPageTitleInTitleArea">
    List Details
</asp:Content>
<asp:Content runat="server" ContentPlaceHolderID="PlaceHolderPageTitle">
    List Details
</asp:Content>

+ Recent posts