Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Going at the end of a browser page
Message
 
À
08/01/2005 02:21:38
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires Web
Divers
Thread ID:
00974921
Message ID:
00975469
Vues:
21
It appears that in the beta version of visual c# 2005 a webbrowser control is added to the winforms controls. You are using the webbrowser activex control.

I have done some (re)search and it appears that if you want use the execScript working (or webbrowser's document DOM in general)you have to get a reference (in your references) to mshtml.dll. You can do this by 1) right-clicking in the solution explorer 2) add Microsoft HTML Object Library in the COM tab.

I have done this, created a simple form with an activex webbrowser and button. It works great for me using the blank.html explained in my previous post, look if you can adjust it to your needs and vb.net:
private void button1_Click(object sender, EventArgs e)
        {
            axWebBrowser1.Navigate(@"c:\weggooi\blank.html");
            
             mshtml.HTMLDocument MyDocument = 
            (mshtml.HTMLDocument)axWebBrowser1.Document;
            
            // wait for loading the document
            while (MyDocument.readyState != "complete")
            {
                Application.DoEvents();
            }

            
            // Write 1000 lines in HTML Document
            string cString = "My name is Zakaria al Azhar" + "<br>"; 
            for (int i = 1; i <= 999; i++)
            {
                cString = cString + "<br>";

            }

            MyDocument.getElementById("DivInner").innerHTML = cString;
            MyDocument.parentWindow.execScript("Go()", "JavaScript");
  
        }
>>A fast search with google give results that it is possible to run java script with the webbrowser, can you do this? :
>>WebBrowser.Document.parentWindow.execSript("functionName(param1,param2...)")
>>
>>If not I would do a search on google, because I think the solution lies in executing the script....and it is possible.
>
>This gives a No such interface is supported. In the version I am using, it seems that execScript is not available.
Zakaria al Azhar
My blog on Actuaris.net
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform