I loaded a site into a document object and then filled up some values in the
text fields. Then submitted the form programmatically using the code below.
doc.parentWindow.execScript("var aForm=document.getElementById('LoginForm');
aForm.submit();", "JavaScript");
On doing the above, the site returned another web-page. How do I access
that page? I mean how do I get the page into the DOM tree (document
object)? I am interested in "outerHTML" of this returned page.
I am able to do the above if I use the web-browser object directly.
However, I am not supposed to use a web-browser object as I am writing this
program as a service in C#.
To avoid using the web-browser object, I did the following:
THIS IS VB.NET CODE ENCAPSULATED INTO A CLASS LIBRARY THAT RETURNS THE
DOCUMENT OBJECT
------------------------------------------------------
Dim objMSHTML As mshtml.HTMLDocument
Dim objDocument As mshtml.IHTMLDocument2
Dim ips As IPersistStreamInit
objMSHTML = New mshtml.HTMLDocument
ips = DirectCast(objMSHTML, IPersistStreamInit)
ips.InitNew()
objDocument = objMSHTML.createDocumentFromUrl(strURL, String.Empty)
THIS IS C# CODE THAT USES THE DOC OBJECT RETURNED BY VB.NET ABOVE
-------------------------------------------------------------
objDocument .parentWindow.execScript("var aForm =
document.getElementById('LoginForm'); aForm.submit();", "JavaScript");
Now after this point, I want to access the HTML related to the response. I
tried objDocument .outerHTML but that still contains the old HTML. How to
get the HTML of the login response.
PLEASE HELP.....
Thanks,
NG