Help needed with InvokeScript functionality of WebBrowser control

D

Deepesh

Hi all,

I'm using the InvokeScript functionality in one of my projects. But
it seems like it will
invoke the script mentioned only once.

For eg.. I'm doing this in my VB.Net code

ParamArr(0) = CObj(XMLDOM.xml)
WebBrowser1.Document.InvokeScript("UpdatePage", paramArr)

And the JavaScript code looks like this

function UpdatePage(sPageXML)
{
alert("UpdatePage firing")
var pageDocument = (new DOMParser()).parseFromString(sPageXML,'text/
xml');
if(isValidXMLDom(pageDocument))
{
Def = pageDocument;
PageShow(Def); //This method will basically refresh the page;
}

}


The WebBrowser1.Document.InvokeScript("UpdatePage", paramArr) works
well for the first
time..ie the alert of "UpdatePage firing" comes. But when I use the
same line again the
alert doesn't fire.Is there some cache to be removed from the
webBrowser or some objects to
be closed down or refreshed. Could you please help. Also information
about
WebBrowser.ObjectForScripting Property will also be very useful.

Thanks
Deepesh
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top