I can embed this url
http://www.staff.oma.be/StaffBox.jsp[
^] in a webpage through an iframe. With the correct post through a form, I can control this webpage (eg another time window for the graph, another plot, etc ...).
This works in a normal browser, but when I want to use the WebBrowser control in WPF it starts throwing javascript errors all around the place and the frame remains empty (visual), yet the view source, shows the code correctly. Looks like a security issue, but can't find where to correct this.
* searched google, with multiple keywords/sentences
* added <!-- saved from url=(0014)about:internet -->\n\r, but no progress.
* copied the iframe source from the WebBrowser control and saved as html and opened this in a browser => works.
Hopefully someone has an idea.
thanks.
(Visual Studio 2012, .Net 4.5)
[SOLUTION]
* Installed .Net 4.5.2
* Installed CefSharp.Wpf through nuget
* Used that control instead of WebBrowser control in XAML
* added following lines in code
cwb_staffboxes.GetBrowser().MainFrame.LoadStringForUrl(html.ToString(), "http://www.localstaff.be");
cwb_staffboxes.WebBrowser.Load("http://www.localstaff.be");
Note: the http://www.localstaff.be is a dummy url.
[/SOLUTION]
What I have tried:
XAML
<WebBrowser Name="wb_staffboxes" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
Code behind:
wb_staffboxes.NavigateToString(html.ToString());
html.ToString() yields:
This works in a normal browser, but not in the WebControl of WPF.
<html><body><iframe id='sb_sw' name='sb_sw' width='700' height='500'></iframe>
<div style="visibility:hidden">
<form id="sendpost" method="post" action="http://www.staff.oma.be/StaffBox.jsp">
<input type="text" id="txtbox_dtsstart" name="txtbox_dtsstart" value="20150318000000" />
<input type="text" id="txtbox_dtsend" name="txtbox_dtsend" value="20150319000000" />
<input type="text" id="txtbox_plottypes" name="txtbox_plottypes" value="acespeed|ql;" />
<input type="text" id="txtbox_ticksize" name="txtbox_ticksize" value="2" />
<input type="text" id="txtbox_connectdots" name="txtbox_connectdots" value="true" />
<input type="text" id="txtbox_size" name="txtbox_size" value="640;480" />
</form></div><script>document.getElementById("sendpost").target="sb_sw";
document.getElementById("sendpost").submit();</script>
</body></html>