In .NET, When you add an event handler to any of the predefined events in HtmlDocument of WebBrowserContro.Document, it will register a default event handler for all the other events.
If the submit button has an onclick javascript event handler. The javascript returns false to prevent the page to postback. However, return false will not work properly if there is another event handler registered. Instead of returning false, the best choice in the HTML page is to set event.returnValue = false.
Another workaround is to change your .NET code, use AttachEventHandler method instead:
| Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click |
| doc = webBrowserControl.Document |
| doc.AttachEventHandler("onclick", AddressOf oDoc.OnClick) |
| End Sub |
| |
Remove Handles doc.Click in your code.