ASP.NET Silverlight Overview

Introduction

The Silverlight 2 Software Development Kit (SDK) Beta 2 includes ASP.NET server controls for Silverlight that you can use with the Silverlight client plug-in. You can use JavaScript code (a Silverlight 1.0 scenario) or managed code (a Silverlight 2 scenario) to handle interaction with the Silverlight client plug-in.

The ASP.NET controls for Silverlight let you use the familiar ASP.NET server control model to provide Silverlight support, ranging from basic installation support to handling user interaction and working with complex media scenarios. The Silverlight 2 SDK Beta 2 also includes an ASP.NET helper class for Silverlight that provides extensibility scenarios if you are writing custom controls with Silverlight support.

Note

To use the examples provided in this section, you must install the latest Silverlight 2 plug-in. You can download the plug-in from the Silverlight Web site.

This topic contains information about the following:

Features

The Silverlight 2 SDK Beta 2 supports ASP.NET controls for Silverlight, including the following:

  • System.Web.UI.SilverlightControls.MediaPlayer server control

  • System.Web.UI.SilverlightControls.Silverlight server control

For detailed API information, see System.Web.UI.SilverlightControls Namespace.

Background

The ASP.NET server controls for Silverlight enable you to use media such as video and audio to give users a Rich Internet Application (RIA) experience beyond what can be done with AJAX and DHTML alone.

The MediaPlayer control inherits from the Silverlight control. Both controls use Extensible Application Markup Language (XAML) when they are displayed in a Web page. XAML provides UI details that can be referenced and manipulated using a common programming model. The MediaPlayer control uses XAML to display the media skin (media player UI). The Silverlight control displays XAML directly.

When the Silverlight 2 SDK Beta 2 is installed, it adds a MediaPlayerSkins folder to the installation location. This folder contains a XAML file for each MediaPlayer control skin (media player UI). Additionally, when the Silverlight 2 SDK Beta 2 is installed, the Silverlight tab on the Toolbox is available for Web Projects in Visual Studio.

For more information about Silverlight, see the Silverlight Web site and the Silverlight Quickstart documentation.

The MediaPlayer Server Control

The MediaPlayer server control lets you integrate media sources such as audio (WMA) and video (WMV) into your Web application, without requiring any knowledge of XAML or JavaScript. The MediaPlayer control can use pre-built skins, or you can create custom skins. For example, you can reference a custom XAML document that is generated through Microsoft Expression Encoder and that supports captions, chapters, and markers in the media source. When you configure the MediaPlayer control to reference a pre-built skin, the associated XAML document is copied into the project. The MediaSkinSource property of the MediaPlayer is also set to point to the referenced skin. For more information about Expression Encoder, see the Microsoft Expression Encoder Web site.

The control also generates a client JavaScript object that manages user interaction with the player. The control generates the appropriate markup and code to display and control media.

The Silverlight Server Control

The Silverlight server control enables you to reference XAML that you provide. If you use managed code with the XAML, the Silverlight control provides a way to embed the XAML application in the Web page.

Silverlight Controls and the ScriptManager Control

Web applications that use Silverlight controls must also include the ScriptManager control. The ScriptManager control manages all ASP.NET AJAX resources on a page.

Class Reference

The following table lists the primary server classes for ASP.NET server controls for Silverlight.

Class

Description

System.Web.UI.SilverlightControls.MediaPlayer

Enables you to integrate media sources such as audio (WMA) and video (WMV) into a Web application.

System.Web.UI.SilverlightControls.Silverlight

Enables you to provide a Rich Internet Application (RIA) experience with a Web application using Silverlight.

This topic is ASP.NET Extensions documentation and is unsupported by Microsoft. Blank topics are included as placeholders and existing content is subject to change in future releases.