asp.net中的计时器和更新面板的性能问题 [英] performance issues with timers and update panels in asp.net

查看:70
本文介绍了asp.net中的计时器和更新面板的性能问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我在SP网站上有一个aspx页面。它有4个更新面板,每个更新面板(UP)都有一个计时器。每个更新面板都从不同的Web服务获取数据。 UP1中的第一个定时器的延迟为1ms,UP2的延迟为2ms。 UP1每1ms后取数据,UP2每2ms取出一次。类似地,UP3和UP4也可以工作。所有更新面板都需要同时加载数据。



问题是页面的性能非常低,以及哪个代码从一个定时器切换到另一个定时器也是花更多的时间。



任何人都可以帮我解决这个问题,以提高页面的性能。



提前致谢。

解决方案

你好N Sudheer Gupta,



为什么不能你制作单个计时器,这是最小间隔,保持隐藏字段(标志的种类),以区分不同时间间隔运行的代码。所以调用服务器可能会减少权利,因为你的UP1定时器间隔是1ms,所以只允许第一次使用这个(hdnUP2.value = false), UP2不应该运行,接下来打1ms(最后1ms +现在1ms = 2ms)(下次将它变为假时使这个hdnUP2.value = true)现在UP2应该像你提到的那样更新指定服务的数据形式,





希望这会有所帮助



谢谢

快乐编码

Hi,

I am having a aspx page in a SP site. It has 4 update panels and each update panel(UP) has a timer in that. Each update panel is fetching data from different webservices. First timer in UP1 has a delay of 1ms and UP2 has 2ms. UP1 fetches data after every 1ms and UP2 does after every 2ms. similarly UP3 and UP4 also works. All Update panels need to load data simultenously.

The problem is that the performance of the page is very low and also which code switching from one timer to other timer also its taking more time.

Can any one help me in resolving this issue to improve the performance of the page.

Thanks in advance.

解决方案

Hello N Sudheer Gupta,

Why can''t you make single timer, which is least interval, in that keep hidden field (kind of flag) to differentiate the code to be running at different interval. so call to the server may reduce right,

let as your UP1 Timer Interval is 1ms, lets only take this one at first time (hdnUP2.value=false), UP2 should not run, next tick next 1ms (last 1ms + now 1ms=2ms) (make this hdnUP2.value=true next time it will be false ) Now UP2 should update the data form specified service as you mentioned,


Hope this will helps

Thanks
Happy Coding


这篇关于asp.net中的计时器和更新面板的性能问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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