Chapter 12. Adding Silverlight Content to ASP.NET 3.5 Applications
We have already briefly discussed the ASP.NET 3.5 Extensions
in Chapter 3. This package contains features
and controls that are planned for future releases of ASP.NET and .NET. Some
of these improvements have also been added to the Silverlight 2 Visual
Studio project. The automatically generated test pages we have been using
throughout this book are already using some of the new features, the
<asp:Silverlight> control, now part
<asp:Silverlight> control lets you embed
XAML content into an ASP.NET page. We will have a look at what the
client-side HTML output looks like in a second; but before that, here are
the most important attributes of
The URL of the Silverlight XAML file or .xap application to include.
The minimum version of Silverlight that needs to be checked. If you are displaying Silverlight 2 content, set this property to
How to scale the embedded media. Possible values are
ScaleMode.Stretch(stretch without keeping the aspect ratio), and
ScaleMode.Zoom(stretch and keep the aspect ratio).
The width (in pixels) of the Silverlight control.
The height (in pixels) of the Silverlight control.
Here is an example:
<asp:Silverlight ID="Silverlight1" runat="server" Source="MyApplication.xap" Version="2.0" Width="250" Height="250" />
To use this control, you may have to load the appropriate assembly, depending ...