locked
updatepanel timer every one second RRS feed

  • Question

  • User932259438 posted

    hi,

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Xml.Linq;
    
    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
    
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            XDocument document = XDocument.Load("http://localhost:56466/1000217859.xml");
    
    
            var test = from t1 in document.Descendants("path")
                         where t1.Parent.Element("path").Element("name") != null
                       select t1.Parent.Element("path").Element("name");
    
         //   IEnumerable<XElement> list1 = document.Root.Descendants("events");
    
    
            GridView1.DataSource = test;
            GridView1.DataBind();
        }
        protected void Unnamed_Tick(object sender, EventArgs e)
        {
            XDocument document = XDocument.Load("http://localhost:56466/1000217859.xml");
    
    
            var test = from t1 in document.Descendants("path")
                       where t1.Parent.Element("path").Element("name") != null
                       select t1.Parent.Element("path").Element("name");
    
            GridView1.DataSource = test;
            GridView1.DataBind();
        }
    }

    My code working...

    I want to ask you how to use timer every one second.

    Before:


    after:



    I need every one second to show first picture. Marked text.
    Thanks.


    Saturday, January 23, 2016 2:32 PM

Answers

  • User61956409 posted

    Hi progy85,

    Ajax Timer control performs postbacks at defined intervals, you could try to set Interval property to “1000”.

    <asp:Timer ID="Timer1" runat="server"
        Interval="1000"
        OnTick="Timer1_Tick">
    </asp:Timer>
    

    Best Regards,

    Fei Han

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, January 25, 2016 5:11 AM