<asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:Timer ID="Timer1" runat="server" Interval="5000">
    
    </asp:Timer>
    
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
   <asp:Label ID="lblTitleType" runat="server"></asp:Label>
    </asp:UpdatePanel>
    
如何使用Timer控件,每5秒刷新Label控件,求解答

解决方案 »

  1.   

    将Timer控件放入updatepanel然后再Timer1的tick事件中写你的刷新代码
      

  2.   

    http://book.51cto.com/art/200809/91118.htm
      

  3.   

    我不需要刷新代码,只想定时刷新我的label控件
      

  4.   

    我不需要刷新代码,只想定时刷新我的label控件
      

  5.   

    设置Timer1的tick事件中写你的刷新代码
    this.Label1.Text=DateTime.Now();
      

  6.   

    ...Timer1_Tick(...,...)
    {
     this.Label1.Text="Label总要显示文本值吧,你想‘刷新’,就在这里改变值就行啦";
    }
      

  7.   

    你这个updatepannel。。 <ContentTemplate>都不加。。不报错?你上面是写实现无刷新吗?<Triggers>
    <asp:PostBackTrigger ControlID="Timer1" />
    </Triggers>