0

我有 ASP.NET 页面,Page1.aspx 和 Page2.aspx。在 Page2.aspx.cs 中,我在 PageLoad 中调用了一个计时器:

timer1 = new System.Timers.Timer(4000);
timer1.AutoReset = true; 
timer1.Elapsed += timer1_Tick;
timer1.Start();

当我在浏览器中从 Page2 转到 Page1 时,我发现当我在 Page1 中浏览时 timer1 正在执行。在我从 Page2 出去的地方停止 timer1 的最佳方法是什么。

谢谢你,对不起我的英语,我尽力了。

4

0 回答 0