在ASP.NET Ajax中停止并启动Timer

MrH*_*ood 4 asp.net-ajax

如果你有一个ASP.NET UpdatePanel和ASP.NET计时器来试图刷新更新的面板,那么在javascript中是否可以停止/暂停计时器?

我想在用户鼠标悬停在更新面板上时停止计时器!

小智 11

最好的方法是使用enabled属性进行计时器控制

timer1.Enabled = false; //For stop the timer

timer1.Enabled = true; // For starting the timer
Run Code Online (Sandbox Code Playgroud)