开发者

Adding Silverlight pages to existing ASP.net page?

I know how to add SL page as a whole to existing ASP.net application. We have existing ASP.ne开发者_如何学运维t page with few tabs. Each tab is a user control. We want to add another tab, which will host Silverlight content.

  1. Is it possible to add silverlight content in one of the tabs of a page? Any example links?

Another way of putting up the same question :

  1. Is it possible to have an ASP.net page with top half as regular asp.net content and other half containing silverlight content?

Please advise. Thanks AJ


This is how you embed Silverlight controls into webpages (just use plain html):

<body>
    <form id="form1" runat="server" style="height:100%">
    <div id="silverlightControlHost">
        <object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">
          <param name="source" value="ClientBin/SilverlightApplication1.xap"/>
          <param name="onError" value="onSilverlightError" />
          <param name="background" value="white" />
          <param name="minRuntimeVersion" value="4.0.50401.0" />
          <param name="autoUpgrade" value="true" />
          <a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=4.0.50401.0" style="text-decoration:none">
              <img src="http://go.microsoft.com/fwlink/?LinkId=161376" alt="Get Microsoft Silverlight" style="border-style:none"/>
          </a>
        </object><iframe id="_sl_historyFrame" style="visibility:hidden;height:0px;width:0px;border:0px"></iframe></div>
    </form>
</body>

You basically need to refer to your .xap file in "param" element in object data. So yeah, you can combine Silverlight and HTML content. Just embed Silverlight wherever you need it in your ASP page. Hope this helps.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜