【发布时间】:2009-04-28 09:03:13
【问题描述】:
如果您有一个 ASP.NET 更新面板和触发更新面板刷新的 ASP.NET 计时器,是否可以在 javascript 中停止/暂停计时器?
当用户将鼠标悬停在更新面板上时,我想停止计时器!
【问题讨论】:
标签: asp.net-ajax
如果您有一个 ASP.NET 更新面板和触发更新面板刷新的 ASP.NET 计时器,是否可以在 javascript 中停止/暂停计时器?
当用户将鼠标悬停在更新面板上时,我想停止计时器!
【问题讨论】:
标签: asp.net-ajax
最好的方法是使用定时器控件的启用属性
timer1.Enabled = false; //For stop the timer
timer1.Enabled = true; // For starting the timer
【讨论】:
http://forums.asp.net/t/1094798.aspx
然后只需将客户端事件附加到更新面板ala -
http://encosia.com/2007/07/13/easily-refresh-an-updatepanel-using-javascript/ - 但改为 onmouseover 来调用它们。
【讨论】: