In This Chapter
Connecting to the Web to get data
Downloading files to your application
Talking to Web services
Understanding cross-domain security
Silverlight is a client-side technology that runs in the Web browser and is therefore disconnected from the server. This fundamental aspect of Silverlight plays a major part in how Silverlight applications "talk" to the server. Your Silverlight application runs inside your user's browser, so to get data from the server, you as the application developer need to communicate with it through some sort of service.
Your application data and certain types of resources are kept on the server for a number of reasons. For starters, your application probably needs only some of the data in a database. Downloading all of the data in the database not only takes a very long time but could also compromise your application if the wrong data is shown to the wrong user. If your application is media-intensive, you want to show only the media that the user wants, rather than downloading your whole media library to them. One site that is an example of this scenario is YouTube (
www.youtube.com). You download only the videos you want to watch, not all of the millions of videos available. With media such as videos, you can also set up a streaming service to stream videos to the user before they have finished downloading.
When you are developing your Silverlight application, you will quite often build the service as well, so ...