pzogr
pzogr

Reputation: 424

C# detect postback in webbrowser control

I've created an application that grabs data from a web page and saves them to a database. This pages sends some __postbacks. After the postback the page loads some data that I need to save. I do not know how to detect this event so I've created a button which grabs the data when pressed by the user. How can I automate the process so that the user won't have to check for the postback himself? That is how can I detect the postback event in my webbrowser control?

Upvotes: 0

Views: 1836

Answers (1)

aquinas
aquinas

Reputation: 23796

The webbrowser control has a DocumentCompleted event. You can use the WebBrowser.Document property to look for something specific in this event.

private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e) {
  if (webBrowser1.Document.Body.InnerHtml.Contains("some way that I know I am ready"))
  }

Upvotes: 1

Related Questions