开发者

Can I use the silverlight server control inside an asp.net mvc 2 page?

I can't find开发者_运维问答 it when typing

<asp:


With MVC you don't use webform controls. <asp:...> are tags used by webform controls. Silverlight doesn't require a webform control to work anyways, you just need to add the following HTML to your view:

<object id="objYourSilverlightControl" data="data:application/x-silverlight-2,"
    type="application/x-silverlight-2" width="500px" height="500px">
    <param name="source" value="../ClientBin/youSilverlightControl.xap"/>
    <param name="onError" value="onSilverlightError" />
    <param name="background" value="white" />
    <param name="minRuntimeVersion" value="3.0.40624.0" />
    <param name="autoUpgrade" value="true" />
    <param name="windowless" value="true" />
    <a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=3.0.40624.0"
        style="text-decoration:none">
        <img src="http://go.microsoft.com/fwlink/?LinkId=108181"
            alt="Get Microsoft Silverlight" style="border-style:none"/>
    </a>
</object>

I think the webform control that you are referring is no longer supported anyways (it might be still but I have never needed to use it).

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜