c# - Waiting for WebBrowser ajax content -


I want to stop the execution of my thread unless a particular dib was loaded by azaq in a webbrown instance. Got it Obviously I can check the presence of this div continuously:

  while (Browser.Document.GetElementById ("divid") == tap) {thread. Sleep (200); }  

However, the thread is sleeping that the browser is only in the middle of the loop, in fact the browser actually blocks the browser from loading in the first place. It seems, therefore, I need to execute the Browser.Navigate method in a separate thread - I can then continue to check / wait the presence of a div when the Web Bravery instance URL is loading I said to do it.

My efforts on this, however, are unsuccessful and I have no input value on how I should go about this. I thought that a new thread would have to be sent with new thread ((=) => {Browser.Navigate (url);}), but after doing this, nothing loads And browser. 'Uninitialized'. I think I'll misunderstand how to go about threading processes in such a way with C # and go for some advice!

"post-text" itemprop = "text" P> Do not block the message pumps of the main thread. Since the browser is an STA component, xmlhttprequest will not be able to raise events from the background bar if you block message pumps. You can not navigate to the background thread. Webbrover ActiveX does not support access from other threads with the Windows Form Cover UI thread. Use the timer instead.


Comments