如何在aspx页面上设置一个定时器? 比如“10米澳洲自动跳转到主页”,后台代码如何写?

解决方案 »

  1.   

    用 js interval()or timeout
    函数
      

  2.   

    自动跳转在页面的<head></head>里写就可以
    <meta http-equiv="REFRESH" content="15;URL=你要跳的地址" />
      

  3.   

    < script>setTimeout("location.href='url'",2000)< /script>  
    < meta http-equiv="refresh" content="300; url=target.html"> 用window.location.href
    System.Timers.Timer t= new System.Timers.Timer();
      t.Interval = 1000;
      t.Enabled = true;
      private static void OnTimedEvent(object source, System.Timers.ElapsedEventArgs e)
      {}
      

  4.   

    估计楼主应该花些时间多多研究 JavaScript 了,很多我们想实现的功能完全可以用 JS 来解决。不要总是把什么事儿都让服务器来做,要不然服务器过于忙,说不定会被弄瘫痪的。