Including a Silverlight application in a user control was not as easy as I expected...
In a recent project I created a new Silverlight application which was going to be included in an existing ASP.NET website. The Silverlight application was going to be called from a User Control (myfile.ascx) in the site.
So far, no problem. I started to implement my code to log exceptions from Silverlight to the web server via the HtmlPage.Window.Invoke method. This did not work as I expected.
Here is a summary of the changes which resolved my problem:
Template.master (Master page for all pages on the site)
Default.aspx. (Contains the user control)
myfile.ascx (contains the Silverlight application)
After completing these changes my Silverlight application is happy again. The best news is that when I added another Silverlight application to this solution everything was already to roll. I was able to use the Web Methods I had previously included in Default.aspx.
I hope you find this tip useful!
Thanks and keep on coding!