This is easily reproducible...
1) Create a test html page such as
C:\Temp\Test.htm with this code..
If you load the page above using the IE browser, both hyperlinks should work. Now in the IE browser, if you you click the "Show Me as Modal Page." button, the same page opens as MSHTML dialog window and again on that both hyperlinks work.
This is expected.
2) Now create a
WinForm app hosting
WebBrowser control sourced to "C:\Temp\Test.htm"
<WebBrowser Source="C:\Temp\Test.htm" Height="500" Width="500"/>
If you run the app and load the test page using the
WebBrowser control, both hyperlinks will work on the loaded page.
But if you load the modal window using the "Show Me as Modal Page." button, then the modal window fails to alert using the first hyperlink i.e.
I should work using href. does not appear.
Second hyperlink works as expected.
Do you guys reckon is there a workaround for the first hyperlink to work?
In my case I have no access to the page's content that I am loading using the
They say that
FEATURE_SCRIPTURL_MITIGATION has to be enabled for this. But it is already enabled in my registry. The MSDN continues to say ...
By default, this feature is enabled for Internet Explorer and disabled for applications hosting the WebBrowser Control. It has to be manually enabled for webBrowser control.
How to enable this for the web browser control?
This feature is not supported for applications hosting the WebBrowser Control.
©2020 All rights reserved.