Link to home
Start Free TrialLog in
Avatar of aplelois
aplelois

asked on

go to next page

hello,
I would like to create soemthing so that when I click this button
WebBrowser1.Navigate(New System.Uri("http :// domain com"))

it goes to this page and then click on next >>
then next, next, etc...

<a href="javascript:back(1);"><< back </a>| <a href="javascript:next(3);">next >></a>

page3 has javascript:next(4);
page4 has javascript:next(5);
so on.. how can I do this ?
Avatar of wtconway
wtconway

Are you wanting to let a button on your form send these commands to the webbrowser control? Or are you just wanting the user to click the links in the webbrowser control and have it go to the next page?
Avatar of aplelois

ASKER

yes = Are you wanting to let a button on your form send these commands to the webbrowser control
I answered a similar question to this a while back. Check this post out:

https://www.experts-exchange.com/questions/21524297/executing-javascript-using-webbrowser-control.html
this is my javascript

        function next(pageNumber)
        {
            theForm.page.value = pageNumber;
              theForm.action = "search.php";
              theForm.submit();
              return true;
        }      
I haven't done this in a while. Let me do some testing and I'll get back to you.
ASKER CERTIFIED SOLUTION
Avatar of wtconway
wtconway

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I'm about to leave the office for the evening. I'll check your responses in the morning.
I get these two things

Error      1      Type 'mshtml.HTMLDocumentClass' is not defined.      
Error      2      Type 'mshtml.HTMLScriptElementClass' is not defined.
Do you have a webbrowser control in your application? That class should be added as a reference. If it is not then look here:

C:\WINDOWS\assembly\GAC\Microsoft.mshtml\7.0.3300.0__b03f5f7f11d50a3a\Microsoft.mshtml.dll

I'm running XP Pro SP2 and that is where M$ installed that DLL for me. Perhaps it is there for you. If not, just search your drive for that DLL and add it as a reference in your app.
done, now this

Error      1      Value of type 'System.Windows.Forms.HtmlDocument' cannot be converted to 'mshtml.HTMLDocumentClass'.

Dim doc As mshtml.HTMLDocumentClass = Web.Document

error = Web.Document
I had to change it to -> WebBrowser1.Document.DomDocument
ok i have a problem the html page doesnt have any type="button" it only has this
<a href="javascript:GotoPage(1);">1</a>
<a href="javascript:GotoPage(2);">2</a>
<a href="javascript:GotoPage(3);">3</a>
<a href="javascript:GotoPage(4);">4</a>
<a href="javascript:GotoPage(5);">5</a>
got it thanks
So everything works now?
yes