WebBrowser Control of Silverlight

WebBrowser control is a very handy tool to display a web page in a Silverlight app. This allows some functions of apps be moved to easily maintained web pages.

It is easy to use, but has an odd property IsScriptEnabled. According to MSDN it "Enables or disables scripting. This applies to the next document that is navigated to, not the current document. This property is false by default. Set this property to true to enable scripting, or false to disable scripting."  It does not affect the current page.  I have never seen such a bizarre behavior of a property.  If WebBrowser is used to display a page with scripting enabled, it has to display a web page first and sets IsScriptEnabled to true, then go to the target page. 

This article was updated on 00:56:59 2024-03-24