开发者

whats the best way to include silverlight pages into an asp.net-mvc site

i have an asp.net-mvc website and i want to merge in some functionality from a silverlight app. i could rewrite 开发者_运维问答but for the time being i wanted to see if there is any clean way to "include" a few silverlight pages inside my mvc app.

what is the recommended way of doing this ?


The New Silverlight Application Wizard allows you to choose ASP.NET MVC as host application and it will setup the necessary parts:

whats the best way to include silverlight pages into an asp.net-mvc site

All that you need is to embed the Silverlight application in any view:

<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">
      <param name="source" value="ClientBin/SomeSlApp.xap"/>
      <param name="onError" value="onSilverlightError" />
      <param name="background" value="white" />
      <param name="minRuntimeVersion" value="4.0.50826.0" />
      <param name="autoUpgrade" value="true" />
      <a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=4.0.50826.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>

You could also write a HTML helper allowing you to achieve this in a cleaner way.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜