can we add silverlight application in tool box of asp.net web application
can we add silverlight application to tool box of asp.net web form application so that instead of writing HTML to include silverlight application i 开发者_开发技巧can just drag n drop it from tool box.
You can't add a silverlight app directly to the tool box. However its fairly simple to create a WebControl
whose Render
method writes out the appropriate <object>
element with the source param pointing at your applications xap.
You can even add some properties from which that your render code could generate an initparams <param>
element.
This WebControl
would automatically end up in the ToolBox allowing you to drag it on the design surface.
You might even consider detecting that the control is rendering in the design time and change the output to display a reasonable placemarker for it in the designer.
Some versions ago Silverlight had a Silverlight Server control.
There is still one available here.
精彩评论