I saw a lot of posts on this particular subject about SO, and also on the Internet in general, and most, if not all of the code, as shown below.
private void btnSubmit_Click(object sender, RoutedEventArgs e) { webBrowser1.Navigate(new Uri("http://samples.msdn.microsoft.com/workshop/samples/author/dhtml/refs/onsubmit.htm")); } private void btnLogin_Click(object sender, RoutedEventArgs e) { mshtml.HTMLDocument htmlDoc = null; htmlDoc = (mshtml.HTMLDocument) this.webBrowser1.Document; if (webBrowser1.Document != null) { foreach (mshtml.HTMLFormElement form in htmlDoc.forms) { form.submit(); break; } } }
The code has no errors, except for the whole life that it does not send. The example page that I use has a simple button, what does it do, it warns the radio button selection, and then submits the form. For some strange reason, when a form is submitted via code using the WebBrowser control, the form is submitted, but the warning never appears.
I'm not sure what I'm doing wrong here. Any help on this would be appreciated.
c # controls wpf-controls webbrowser-control
vikramjb
source share