wpf-webbrowser的LoadCompleted事件是否包括ajax调用完成? [英] Does wpf-webbrowser's LoadCompleted event include ajax call complete?

查看:108
本文介绍了wpf-webbrowser的LoadCompleted事件是否包括ajax调用完成?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在从正在加载的页面进行任何ajax调用之后,是否引发WPF WebBrowser的LoadCompleted事件.我想记录一个aspx页面完全加载所花费的总时间,包括所有存在的ajax调用.


我正在使用VS 2010(.NET 4.0)窗口窗体,并放置了Webbrowser控件.使用webbrowser的导航方法,我加载了每个aspx页面并记录了每个页面的总加载时间.

当我加载一个aspx页面时,即使有一些ajax调用仍在等待完成,也会触发浏览器的LoadCompleted事件.

是否有任何事件或以任何方式知道aspx页面已完全加载,并且其所有请求均已完成.



是否可以使用其他控件代替WebBrowser控件.

感谢您对此进行调查.

Sen

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

推荐答案

您需要做的是更改浏览到的网页.如果您不能这样做,可以立即停止阅读.如果可以,请尝试以下操作:

将这样的代码添加到您的页面:

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:

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



将该方法的功能与一个标志结合使用,该标志指示网页和ajax东西是否已完成加载,将时间存储在数据库中,并使用Web服务检索该值.



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.


这篇关于wpf-webbrowser的LoadCompleted事件是否包括ajax调用完成?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆