title: How to display records with time interval
body: <p>I have a website i.e. I'm working on aspx pages. I am storing value in to the xml file.
  I need to display value stored in xml at specified time interval (say 1 min) on a asp label. But not all records are to display at an instance. At first instance first record of xml and after time interval next record and so on. After last record again first record needed to display.</p>
  
  <p>I Google search a lot on this but could not find specific solution on this.
  Please help me with successful solution. Thanks...</p>
  
  <p>This is my code but its not giving expected results. Please help me in editing this.</p>
  
  <p>HTML code</p>
  
  <pre><code>&lt;div&gt;
  &lt;table width="100%"&gt;
  &lt;tr&gt;&lt;td&gt;
  &lt;asp:ScriptManager ID="ScriptManager1" runat="server"&gt;
  &lt;/asp:ScriptManager&gt;
  &lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;
  &lt;asp:Timer ID="Timer1" runat="server" ontick="Timer1_Tick"&gt;
  &lt;/asp:Timer&gt;
  &lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;
  &lt;asp:UpdatePanel ID="UpdatePanel1" runat="server"&gt;
  &lt;ContentTemplate&gt;
  &lt;asp:Label ID="Label1" runat="server" Text="" &gt;&lt;/asp:Label&gt;
  &lt;/ContentTemplate&gt; 
  &lt;Triggers&gt;
  &lt;asp:AsyncPostBackTrigger ControlID="timer1" EventName ="tick" /&gt;
  &lt;/Triggers&gt;
  &lt;/asp:UpdatePanel&gt;    
  &lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
  &lt;/table&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>ASPX coding</p>
  
  <pre><code>public partial class UpdateNews : System.Web.UI.Page
  {
  DataRow dr;
  int i = 1;
  protected void Page_Load(object sender, EventArgs e)
  {
  if (!ScriptManager1.IsInAsyncPostBack)
  Session["timeout"] = DateTime.Now.AddMinutes(120).ToString();
  //GetNewValue();
  }
  protected void Timer1_Tick(object sender, EventArgs e)
  {
  if (0 &gt; DateTime.Compare(DateTime.Now,
  DateTime.Parse(Session["timeout"].ToString())))
  {
  i++;
  GetNewValue();
  }
  }
  public void GetNewValue()
  {
  DataSet ds = new DataSet();
  ds.ReadXml(Server.MapPath("News.xml"));
  DataTable dt = ds.Tables[0];
  if (i &lt;= dt.Rows.Count)
  {
  dr = dt.Rows[i - 1];
  Label1.Text = dr["Title"].ToString();
  }
  else
  {
   if(i &gt; dt.Rows.Count )
   i = 1;
  }
  }
  }
  </code></pre>