开发者

How to embed a SilverLight control in ASP.NET control (user or custom)

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

We make 开发者_如何学Goextensive 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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜