Share via


Lab 2: Migrating an ASP.NET Web Forms Application to Silverlight

Silverlight provides a Rich Internet Application (RIA) framework that can be used to build applications that can be deployed through the Web while preserving the rich client-side functionality found in traditional desktop applications. This lab is designed to guide ASP.NET and jQuery developers through the process of migrating applications to Silverlight.

In the lab you'll convert an existing ASP.NET/jQuery application that consumes data from a Windows Communication Foundation (WCF) service to Silverlight and ensure that existing functionality is preserved. Along the way you'll learn how to create a Silverlight user interface, handle events, make asynchronous calls to services, bind data to controls, plus more.

You'll start by researching existing data access and WCF service projects used by an ASP.NET application. Next, you'll run the ASP.NET application to see the feature set that will be migrated to Silverlight. To accomplish the migration you'll create a new Silverlight project in Visual Studio 2010 and use eXtensible Application Markup Language (XAML) along with managed code (both C# and VB are supported in the lab). The Silverlight application that you'll create is shown next:

Figure 1

Customer Details

You Will Benefit from this Lab if:

  • You are migrating an ASP.NET Web Forms application to Silverlight
  • You'd like to create a rich-client application that takes advantage of a web-deployment model
  • You need to integrate distributed data into an application

You Will Learn:

  • How to use the Visual Studio 2010 Silverlight Designer
  • XAML and Silverlight control concepts
  • How WCF services can be integrated into Silverlight applications
  • Silverlight data binding techniques
  • How to make asynchronous calls to services
  • How to work with cross-domain services
  • Similarities between ASP.NET and Silverlight applications

Business Requirements for the Silverlight application include:

  1. Create a new Silverlight project and associated ASP.NET Web Application project
  2. Re-use existing data access and WCF service code
  3. Use XAML to define the user interface and emulate the ASP.NET application
  4. Handle user interface events
  5. Create a WCF service proxy
  6. Call the WCF service using the asynchronous programming model
  7. Bind data to controls using Silverlight binding syntax
  8. Handle update and delete operations and notify the user about the status of the operation