I am using a webbrowser control embeded in C# WPF .NET4 app. Whenever I press manually the button in a form, the browser hangs on "Your request is being processed" message and nothing happens. If I do the same in full IE browser the page is processed normally producing the results. What I am missing? Thanks The code behind the button is the following
<a onclick="startSearch();" href="javascript:void(-1);" name="btnNext" class="btn floatLe noClear btnSubmit btnRight">
<span>Continue</span>
</a>
This works for me:
yourWebBrowser.ScriptErrorsSuppressed = true;
WebBrowser control (both WPF and WinForms versions) behaves in many ways differently from the full IE. You may want to implement Feature Control to bring its behavior as close to IE as possible (particularly,
FEATURE_BROWSER_EMULATION
), this often solves the script compatibility issues. Here is some code, note that it does not require admin rights to run:For example:
You should come up with your own set of features and register them before WebBrowser has initialized, e.g., in the main form constructor:
Updated, I currently use and recommend a set of features that can be found here.