开发者

Silverlight InitParams prompting to install Silverlight in Mozilla and Chrome

I have a problem with a Silverlight control's behavior in an ASP.NET page. The control works OK within IE, but in Mozilla, I get the 'install Microsoft Silverlight' message.

After some try/fail sessions, I开发者_如何学C came to the conclusion that I get that message in Mozilla only if I use the <param name="InitParams"/> param in my Silverlight control. If I delete the param, it's all OK.

Has anyone had this issue before ?

ASP.NET page code:

<div style="height: 100%; width: 100%;">
    <object  data="data:application/x-silverlight-2," type="application/x-silverlight-2"
        width="100%" height="100%">
        <param name="source" value="http://server/domain/ClientBin/MyName.xap" />
        <param name="onError" value="onSilverlightError" />
        <param name="background" value="white" />
        <param name="minRuntimeVersion" value="3.0.40818.0" />
        <param name="autoUpgrade" value="true" />
        <param name="EnableGPUAcceleration" value="true" />
        <a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=3.0.40818.0" style="text-decoration: none">
            <img src="http://go.microsoft.com/fwlink/?LinkId=108181" 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>


It seems that I have resolved the issue. At least I have figured out the problem. If I have '/> param in my silverlight object.

The InitParams property servers side works in any way in IE. But in Mozilla, if the InitParams property ( which is a string ) is null or string.empty, Mozilla doesn't render the silverlight application, only the download silverlight frame.

This is very strange, because the html result from the .asp page is the same in every browser. Anyway, if InitParams has a value, all is working great. So I think, for the moment, this is the right solution, just add some dummy value in there.


This would be easy to test, but the param name is not InitParams but rather initParams. Perhaps IE is more forgiving of the casing.

Example here.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜