views:

119

answers:

1

We have a ASP.NET web application written in VB.NET where we build content programmatically during the Init event.

We make extensive use of user controls, building them on the fly, and I now want to start including SilverLight content.

Is there an easy way of embedding a SilverLight application in a control, and then instantiating the whole thing in code, in the same way as you'd programmatically add ordinary ASP.NET controls to a page?

The SilverLight component itself works fine when added to a page using the <object> tag but I really want to be able to reuse it elsewhere in code.

Since I'm expecting use of SilverLight to increase in our application, and the asp:Silverlight control seems now to be deprecated, I'm looking for an alternative way of wrapping the content.

Thanks for any pointers.

+2  A: 

You can make your own version of the deprecated Silverlight control - all it has to do is emit the appropriate <object> html during its Render event. This is a really straight forward 5 minute task to roll one of these up.

slugster
Usually when someone says something's a 5 minute task, I go 'yeah right', and wait for the pain to start. But this time, it really was. Thanks very much indeed!!
ChrisA