I’m having difficulty using a WebBrowser control in a WindowsForms application. I use Windows 7, and VS 2012 VB and am using the .Net Framework 4 Client Profile.
I am able to load the form, login to the site by clicking the submit button, Navigate to the form I want, Click on a button to open up the additional fields and Then get the fields to display the values I am needing. The form has several required field / other validators and I thought that was the problem (that I was not passing the validation tests on my data).
That may be the problem since I cannot just click on the Enroll button on the form, and get the data to submit.
I can submit the data on another stand IE 10 browser not part of my form. The data is valid.
Then Enroll button does appear to launch a JavaScript function to display a temporary password. The form uses many Ajax controls for validation etc. and that may be part of my problem. I don’t see everything when I view the WebBrowser1.Document.All that I see when I look at what the control renders. I thought it was a matter of html encoding but that doesn’t seem to be it.
Here is the point at which I am stuck.
EnrollButton = wbIsaac.Document.GetElementById("btnEnroll")
'EnrollButton.Focus()
'PauseTime(0.5)
'EnrollButton.InvokeMember("click")
I get the “EnrollButton” HtmlElement (when I put a breakpoint and a watch on EnrollButton I see it has the following OuterHtml
"<INPUT onclick="enrollmentSave('true', 26, 0, 1015, 1016, '/Patient/Search', 'confirm-dialog', 'New Temporary Password', 'OK', 'Cancel');" id=btnEnroll type=button value=Enroll>"
Perhaps my error is somewhere before this, some validation step that is failing and the form will not allow the patient (record) to enroll (submit).
Any ideas on how to proceed?
Durham Regional Cancer Centre, Canada