Jes Sie

Jes Sie

  • 699
  • 1.2k
  • 265.2k

Timer and Update Panel

Jan 31 2018 3:48 AM
I have a page in my asp.net web forms with a timer and an update panel. My page is on a Master page. 
 
  1. <asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">  
  2.     <br />  
  3.     <asp:Timer ID="Timer1" runat="server"  
  4.         Interval="12000" OnTick="Timer1_Tick">  
  5.     </asp:Timer>  
  6.     <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">  
  7.         <ContentTemplate>  
  8.             <fieldset class="container">  
  9.                 <legend><strong>Formal Teacher Evaluation</strong></legend>  
  10.   
  11.                 <div class="row">  
  12.                     <div class="col-lg-2">  
  13.                         <asp:Label ID="label1" runat="server"></asp:Label>  
  14.                     </div>  
  15.                 </div>  
  16.             </fieldset>  
  17.         </ContentTemplate>  
  18.         <Triggers>  
  19.             <asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" />  
  20.         </Triggers>  
  21.     </asp:UpdatePanel>  
  22. </asp:Content>  
 in code behind I have this:
 
  1. protected void Timer1_Tick(object sender, EventArgs e)  
  2.         {  
  3.             label1.Text = "Time updated : " + time; 
  4.         }  
It updates after the interval time lapsed. But, the panel only updates once. How can I make the update panel updates every after interval time? 
 
Thank you for any help. 

Answers (3)