Click here to Skip to main content
15,887,267 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Does the WPF WebBrowser's LoadCompleted event raised after any ajax calls from the page being loaded. I want to record the total time taken by an aspx page to load completely, including all ajax calls if any present.


I'm using VS 2010 (.NET 4.0) window form and placed a Webbrowser control. Using webbrowser's Navigate method I load each aspx page and record the total load time for each page.

When I loaded an aspx page, the browser's LoadCompleted event fired even when there are some ajax calls still pending to complete.

Is there any event OR any way to know the aspx page is completely loaded with all its requests are done.

OR

Is there any other control which could be used instead of WebBrowser control.

Thank you for looking into this.

Sen
Posted

1 solution

What you need to do is change the web page that you're browsing to. If you can't do that, you can stop reading now. If you CAN, try this:

Add code like this to your page:

C#
Sys.Application.add_load(function() { anotherFunctionCall(); }); 


Combine the functionality of that method with a flag indicating whether or not the web page and the ajax stuff have finished loading, store the time in a database, and use a web service to retrieve that value.
 
Share this answer
 
Comments
Arni Senthil 22-Aug-11 14:05pm    
john, thanks for your reply. But I CAN-NOT edit the page I access to. :-(
#realJSOP 22-Aug-11 14:18pm    
Well then, the short answer is - "You're screwed."
Arni Senthil 22-Aug-11 14:41pm    
yep.. reality is hard to digest but true and screwed :-)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900