Hey, so i'm working on an application that use a webbrowser to access a link. Now, this first link it accesses (we'll call it URL.com/process1.php) redirects to the second link (we'll call this one URL.com/process2.php). So between process1 & process2 we want to pause the navigation, do some stuff and then resume the navigation. The idea seems simple enough using something like this:
The problem comes with the fact that when we access process1.php, the webbrowser never accesses the "DocumentCompleted" handler. Because of this, I'm not able to throw the "DoStuff()" command in between these redirects and stall them. If anyone has some ideas, or a way to do this let me know, thanks. I traced it out with fiddler under normal circumstances and it shows it Posting to process1 and then Getting from process2. Which is right, i just need to know how i can make sure webbrowser1.documentcompleted is invoked between 1 and 2.
Sub web1_docCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgsHandles Webbrowser1.DocumentCompleted
If WebBrowser1.Url.ToString.Contains("process1.php") Then
WebBrowser1.AllowNavigation = False
DoStuff()
End If
End Sub
Sub DoStuff()
' Stuff to do here
WebBrowser1.AllowNavigation = True
WebBrowser1.Navigate(URL.com/process2.php)
End Sub
The problem comes with the fact that when we access process1.php, the webbrowser never accesses the "DocumentCompleted" handler. Because of this, I'm not able to throw the "DoStuff()" command in between these redirects and stall them. If anyone has some ideas, or a way to do this let me know, thanks. I traced it out with fiddler under normal circumstances and it shows it Posting to process1 and then Getting from process2. Which is right, i just need to know how i can make sure webbrowser1.documentcompleted is invoked between 1 and 2.