Silverlight app disappears on page refresh in IE10

前端 未结 6 792
失恋的感觉
失恋的感觉 2020-12-14 22:26

UPDATE: There is a workaround to the problem. It is to force IE10 into compatibility mode by including one of the following meta tags:



        
相关标签:
6条回答
  • 2020-12-14 22:37

    Thanks for all workarounds solution but this is obviously a bug with Silverlight plugin.

    We have raised few tickets directly with Internet explorer development team and they said the issue is from an external problem. It is not a good answer from Microsoft.

    Anyway, this time our developers raised ticket through Silverlight development team which still waiting for their response. To get a good response from them, we need to get more people who are facing this issue.

    You can vote this issue from Connect website which is Microsoft's official bug reporting platform.

    The link to our ticket is: http://connect.microsoft.com/VisualStudio/feedback/details/789004/ie10-shows-blank-page-upon-refreshing-silverlight-app

    Cheers

    Moh

    0 讨论(0)
  • 2020-12-14 22:40

    I still had issues with the solution presented by Chris.

    This works perfectly for me though:

    window.onbeforeunload = function () {
                var silverlightControlHost = document.getElementById("silverlightControlHost");
                silverlightControlHost.innerHTML = "";
            }
    
    0 讨论(0)
  • 2020-12-14 22:45

    I'm seeing the same issue with my Silverlight application in IE 10.

    I've tried adding the IE 8 compatibility meta tag suggested above, but this does not resolve the problem consistently. It seems to work only intermittently, after say every 5th refresh attempt?!

    The only way I can see to work around this consistently is to force the Browser Mode into "IE 10 Compatibility View", and I don't think this can be done via page content (meta tag, etc.)? I've had to remove the IE 8 compatibility meta tag so that the "Compatibility View" button is available in the address bar, and then ask users to click the compatibility button, which is then remembered for the site. This results in the browser entering Browser Mode: "IE 10 Compat View" and Document Mode: "IE7 Standards". The refresh behaviour then works consistently as expected and as it used to.

    This is a big problem for us. We've built our Silverlight app such that the browser refresh button is used to refresh pages/content within the app (the users stays logged in, etc.). It's really bad that we have to ask users to set our site to run in compatibility mode for the refresh functionality to work as expected.

    Note that this still works as expected in Chrome. It seems silly that we might need to recommend that our users use Chrome because of this issue!

    UPDATE:

    A workaround for this seems to be to always load the Silverlight object into its hosting page dynamically using JavaScript.

    E.g.

    function onLoad() {
      var silverlightControlHost = document.getElementById("silverlightControlHost");
      silverlightControlHost.innerHTML = "<object ...
    

    UPDATE 2:

    Here is the latest code I use to work around this issue:

    ...
            function unloadSilverlight() {
                document.getElementById("silverlightControlHost").innerHTML = "";
            }
    
            function focusOnSilverlight() {
                document.getElementById("silverlightObject").focus();
            }
    
            function onLoad() {
                window.onbeforeunload = unloadSilverlight;
                setTimeout(focusOnSilverlight);
            }
        </script>
    </head>
    <body onload=" onLoad() ">
    ...
    
    0 讨论(0)
  • 2020-12-14 22:47

    Yeah i am also facing same issue with one my application. If i opens help of my application in IE 10 then i have to refresh the page each time to view the contents.

    I have two workaround for this issue: 1. Press ALT key once 2. Open IE in compatible mode

    0 讨论(0)
  • 2020-12-14 23:00

    I solved the problem in a very easy way. I Wrote a javascript code at the end of the page (or after the object tag in where is your silverlight app) and set the focus to another element, for example, a link. Example:

    <object id="silverlightHostControl">...bla bla bla</object> <script type="text/javascript" language="javascript"> var shc = document.getElementById("silverlightHostControl"); document.getElementById("myLink").focus(); </script>

    The shc var is useless, I put just for clarify. Remember: your javascript code must set the focus to another (but focusable) object AFTER the silverlight app object tag was parsed, which means your js code is writen after silverlight app object.

    0 讨论(0)
  • 2020-12-14 23:00

    In answer to your question #1, this is happening with our Silverlight apps as well. The only workarounds are 1) restart the browser or 2) switch to compatibiity mode.

    It apparently is a bug in ie10.

    0 讨论(0)
提交回复
热议问题