How to enable JavaScript in a WebBrowser control embedded in a WinForm which is in turn embedded in an XBAP page?

StackOverflow https://stackoverflow.com/questions/8709870

Question

We have a desktop application, which has been provided a web UI by hosting WinForms in XBAP. And it works. Except a particular WinForm in the application which has AxWebBrowser control embedded and it displays content with JS in it. The JS works in desktop app, but not when accessed via web UI.

Again, the structure is like this: XBAP page >> WinForm >> AxWebBrowser. So when I open the web UI in IE, I get "a browser-control within a winform within a browser". And that browser-control doesn't execute any JS.

I have tried setting the browser security to lowest, adding web UI server name to trusted sites and enabled "Allow active content to run in files on My Computer" setting in Internet Options. It didn't help.

Was it helpful?

Solution

Adding Mark of the Web to HTML files shown in AxWebBrowser control, solved the problem.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top