XBAP interop with browser IE 9,10

419 Views Asked by At

I have a HTML page hosting a XBAP. The HTML is as shown below:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html>
    <head>
    **<meta http-equiv="X-UA-Compatible" content="IE=10; IE=9; IE=8; chrome=1">**
        <title>HTML page hosting an XBAP</title>

        <script type="text/javascript">
            var mObject;

            function SetMObj(managedObject)
            {
            mObject = managedObject;
            }

            function Test1()
            { alert("Hello Sujay");}

            function Test() {
                mObject.CallBack(titleInput.value);
            }


        </script>
    </head>
    <body>
        <p>This is an HTML page...</p>

        <div>
        <input type="text" name="titleInput" value="New Title" />
            <button id="btn1"onclick="Test();">
                  Set Notification
            </button>
            </div>
        <iframe src="TestBrowser.xbap" width="700" height="600"></iframe>
    </body>
</html>

When I use the above HTML page, my javascript function calls are not recognised. I get a MissingMethodException in .NET.

However, when I replace the tag as follows, it works fine

So, the problem I have found is with versions IE9 and 10 mentioned in the compatibility. I am currently running this HTML file in IE 9 and 10 browsers on Windows 7.

Is there any fix/workaround for this issue? Thanks in advance for any help on this.

Regards, Sujay

1

There are 1 best solutions below

0
On

There is couple of duplicates about the issue, but I will try not to repeat myself too much.

I found out a solution for this problem and wrote a blog post about it. Solution uses document object that is visible in both Javascript and XBAP side.

XBAP and Javascript with IE9 or newer - Solution for MissingMethodException problems