none
In asp.net Display time periodically in UI page from timer control aspx.cs code RRS feed

  • Question

  • Using System.Timers.Timer in asp.net

    In asp.net , how to send the message for timer periodically for every one minute that particular task completed TIME to UI aspx to display in label control webpage in asp.net ,

    Like without any click events, how to update periodically the label as message from .cs code to aspx page.

    R L Kiran

    Wednesday, July 18, 2018 1:24 PM

All replies

  • Hi Kiran Reddi,

    Thank you for posting here.

    For your question, you could do the code below. 

     public static void Timer()
            {
                Timer aTimer = new Timer();
                aTimer.Elapsed += new ElapsedEventHandler(Method);
                aTimer.Interval = 60000;//one minute
                aTimer.Enabled = true;
            }
    
            private static void Method(object source, ElapsedEventArgs e)
            {
                // Specify what you want to happen when the Elapsed event is raised.
            }

    For further help with ASP.NET, you could post a new thread in ASP.NET forum.

    https://forums.asp.net/

    Best Regards,

    Wendy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, July 19, 2018 2:09 AM
    Moderator