Chapter 10. Programming Silverlight Applications with ASP.NET Services and AJAX

Silverlight provides two controls that allow you to quickly and easily implement the rich functionality of Silverlight in your ASP.NET Web pages. These controls provide the necessary framework for you to implement Silverlight in applications that are based on ASP.NET services.

Using these controls, you can quickly add video, imaging, and other rich graphical components to existing AJAX applications. The following sections discuss using the asp:Silverlight and asp:MediaPlayer controls to integrate Silverlight with ASP.NET services and AJAX.

This chapter is organized almost as a walk-through. The code examples go together to implement an ASP.NET service-based Silverlight application and a media player. Therefore, this chapter makes more sense if you read it from beginning to end.

Creating an ASP.NET Web Service to Use Silverlight

Silverlight 2 was designed to be able to directly interface with ASP.NET Web applications. The ASP.NET control asp:Silverlight was created to directly embed a Silverlight application in an ASP.NET Web page (typically the .aspx file). Using the asp:Silverlight control enables developers to implement Silverlight applications with a rich user interface to their existing Web service applications.

The following sections discuss how to create an ASP.NET Web application that is able to implement a Silverlight application to provide a nice user interface. We are not going to devote much time ...

Get Silverlight™ 2 Bible now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.