[英]ASP.NET Timer + UpdatePanel: How do I stop the event from continually registering?
I have probably worded the question badly, but couldn't figure out how to phrase it. 我可能对这个问题的措辞很差,但无法弄清楚该如何表达。
I have an ASP.NET webpage with a number of update panels and timers to trigger events, but it seems I must be missing something in my implementation, because the behaviour I'm observing can't be right. 我有一个ASP.NET网页,其中包含许多更新面板和用于触发事件的计时器,但是似乎我在实现中一定缺少某些内容,因为我观察到的行为不正确。
I've noticed that every time my Timer fires a tick event I get a new script tag in the <head>
section of my page with the following code: 我注意到,每次我的计时器触发一个滴答事件时,我都会在页面的
<head>
部分中获得一个新的脚本标签,其中包含以下代码:
<script type="text/javascript">
Sys.Application.add_init(function() {
$create(Sys.UI._Timer, {"enabled":true,"interval":1000,"uniqueID":"ctl00$ContentPlaceHolder$missionControl$missionDataControl$MissionTimer"}, null, null, $get("ctl00_ContentPlaceHolder_missionControl_missionDataControl_MissionTimer"));
});
</script>
I figure that code should be added to the page on the first load, but it shouldn't keep duplicating, should it? 我认为应该在第一次加载时将代码添加到页面中,但是它不应该一直重复,应该吗? It's probably something really basic, but what am I missing?
这可能是非常基本的东西,但是我想念的是什么?
There was something causing an update within an UpdatePanel where it shouldn't have been, and was causing some unusual updating duplication. 某个原因导致了不应在UpdatePanel中进行的更新,并且导致了一些异常的更新重复。 Fixing that problem seemed to resolve this issue, and no one seemed inclined to comment, so this is being marked as closed
解决该问题似乎可以解决此问题,而且似乎没有人愿意发表评论,因此已被标记为已关闭
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.