views:

159

answers:

3

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 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&amp;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>
A: 

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.

Bryant
I tested with initParams and the problem is still there.Actually the problem appears when I use something like <param name="initParams" value='<%=InitParams %>...so, when I try to use some server side property to bind the value to that.
nba bogdan
+2  A: 

Hi,

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.

nba bogdan
You are absolutely right. How very strange.
Nestor
I also noticed this problem some time ago. Look at number two here: http://frenk.wordpress.com/2009/11/05/two-silverlight-3-gotchas/
Francesco De Vittori
A: 

problem still exists.....today....

Paul