When adding a Silverlight application to an ASPX page, we can establish different paths for the information flow between them:
Parameters in the URL: It is possible to add parameters to the URL both from the ASPX page and the Silverlight application. This is a way to initialize a Silverlight application, since the application goes back to a starting point in every postback.
Cookies: As with any website, we can access the browser cookies. This access can be used as a way to authenticate a user in the Silverlight application and for the initial configuration.
Session: Instead of transferring the information in the URL, it can be stored in the session of the .NET application. Data is accessed from Silverlight via a call to a web service.
Initparams: Use the initparams of the Silverlight
Object
tag initialization. This can allow us to inject some startup values and collect them when our Silverlight app is instantiated.
As an example, let's see...