
CHAPTER 1 INTRODUCING SILVERLIGHT
3
• ASP.NET website: In this case, Visual Studio creates two projects—one to contain
the Silverlight application files and one to hold the server-side ASP.NET website
that will be deployed alongside your Silverlight files. The entry point to your
Silverlight application can be an ordinary HTML file, or it can be an ASP.NET web
page that includes server-generated content.
So, which approach is best? No matter which option you choose, your Silverlight application will
run the same way—the client browser will receive an HTML document, which will include a Silverlight
content region, and the Silverlight code will run on the local computer, not the web server. However, the
ASP.NET web approach makes it easier to mix ASP.NET and Silverlight content. This is usually a better
approach in the following cases:
• You want to create a website that contains both ASP.NET web pages and
Silverlight-enhanced pages.
• You want to create a Silverlight application that calls a web service, and you want
to design the web service at the same time (and deploy it to the same web server).
• You want to generate Silverlight content indirectly, using specialized ASP.NET
web controls.
On the other hand, if you don’t need to write any server-side code, there’s little point in creating a
full-fledged ASP.NET website. Many of the Silverlight applications you’ll see in this book use basic
HTML-only websites. The examples only include ASP.NET websites when they need specific server-side
features. For example, the examples in Chapter 20 use an ASP.NET website that includes a web service.
This web service allows the Silverlight application to retrieve data from a database on the web server, a
feat that would be impossible without server-side code. You’ll learn how to design an ASP.NET web
service for Silverlight in Chapter 19.
ADDING SILVERLIGHT CONTENT TO AN EXISTING WEBSITE
A key point to keep in mind when considering the Silverlight development model is that in many cases
you’ll use Silverlight to augment the existing content of your website, which will still include generous
amounts of HTML, CSS, and JavaScript. For example, you might add a Silverlight content region that
shows an advertisement or allows an enhanced experience for a portion of a website (such as playing a
game, completing a survey, interacting with a product, or taking a virtual tour). You may use Silverlight-
enhanced pages to present content that’s already available in your website in a more engaging way or to
provide a value-added feature for users who have the Silverlight plug-in.
Of course, it’s also possible to create a Silverlight-only website, which is a somewhat more daring
approach. The key drawback is that Silverlight isn’t installed as widely as other web technologies such as
Flash, and doesn’t support legacy clients such as those running the Windows ME or Windows 2000
operating system. As a result, Silverlight doesn’t have nearly the same reach as ordinary HTML. Many
businesses that are adopting Silverlight are using it to distinguish themselves from other online
competitors with cutting-edge content, but they aren’t abandoning their traditional websites.