I have a web-browser object and the corresponding DOM tree as below (C#
code):
htmlDoc=(HTMLDocument)wb.Document;
IHTMLDOMNode domNode;
domNode=(IHTMLDOMNode)htmlDoc.documentElement;
I want to be able to insert a JavaScript into this DOM tree and then execute
it. This script will fill up the form with some values and submit it.
Can anyone please help me with a code sample for the above.
Any help is much appreciated.
Thanks & regards,
NG
doc.parentWindow.execScript("var aForm =
document.getElementById('LoginForm'); aForm.submit();", "JavaScript");
However I have one problem if I dont use the Web Browser and directly use
the following code without the web browser:
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
<IP> wrote in message news:epGndg80...@tk2msftngp13.phx.gbl...