if you mean server side Timer in a Page class, as you might know, the page code can be executed in a very short time and most of the time, the event related to the Timer will not executed at all, if you want to see the effect, try to add this line in the Page_Load method (assume your Timer's Interval is less than 2 seconds)System.Threading.Thread.Sleep(2000);if you mean to refresh the page, you should use
Response.AddHeader("refresh","2");  //page is refreshed every 2 secondsor equivalent META tag

解决方案 »

  1.   

    我希望服务器端的能每隔一段时间执行一些服务器端代码,比如从WebService得到某些数据,保存在服务器上的某个目录,针对每个链接均应该如此。所以我在页面里放了一个Timer控件。我用调试方式执行,看到,只有一个连接的时候,这个Timer是起作用的,数据可以更新。但是当我有多个连接的时候,发现之后最后一个连接的Timer起作用,以前的连接的Timer不起作用的。但是当我在以前打开的页面上按下了某个Button之后,发现当前活动的Timer就对这个页面起作用了,而其他的的连接的Timer又不起作用了。
    是不是始终只有一个Timer起作用?这些代码都是服务器端代码。
      

  2.   

    我也对这个Timer困惑!
    学习学习!
      

  3.   

    我发现这个Timer还是搞不懂的,还是在Global里面用一个System.Threading.Timer来维护所有的客户端连接比较有效。
      

  4.   

    write a service to do it