Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8618619
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T06:09:02+00:00 2026-06-12T06:09:02+00:00

I have some fairly simple code here, but I can’t for the life of

  • 0

I have some fairly simple code here, but I can’t for the life of me figure out why it’s not working.

I have a page called Update.aspx which contains the following HTML:

<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>

<div>
    Non Panel <%= Date.Now.ToLongTimeString%>
</div>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" ChildrenAsTriggers="False" UpdateMode="Conditional">
    <ContentTemplate>
        <asp:Label ID="lbl" runat="server">Updates in 5</asp:Label>
    </ContentTemplate>
</asp:UpdatePanel>

The code behind looks like this:

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim t As New Timers.Timer
        t.Interval = 5000
        AddHandler t.Elapsed, AddressOf raiseupdate
        t.Start()
    End Sub

    Private Sub raiseupdate(ByVal sender As Object, ByVal e As System.EventArgs)
        sender.stop()
        lbl.Text = Date.Now.ToLongTimeString
        UpdatePanel1.Update()
    End Sub

This is what I’m expecting to happen: The page displays the words “Updates in 5” within the update panel. The timer elapses, calls the raiseupdate() method, and the update panel update() method is called which refreshes the content of the update panel.

What actually happens is this: The timer elapses, the update panel update() method line is reached, but the data never seems to make it back to the page. That is, the words “Updates in 5” are never replaced with the current time.

So I figure I’ve run into some kind of fundamental misunderstanding about what the update() method actually does, but I can’t figure out where I’ve gone wrong. What can I do to make this work?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T06:09:04+00:00Added an answer on June 12, 2026 at 6:09 am

    Looks like the two Updates.. One from the Update Panel and One from Timer is messing your code up.

    Instead you can use ajax Timer and Add this as an AsyncPostBack triggers.. This should do the work for you..

    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    
    <div>
        Non Panel <%= Date.Now.ToLongTimeString%>
    </div>
    <asp:Timer ID="Timer1" OnTick="Timer1_Tick" runat="server" Interval="5000" />
    
    <asp:UpdatePanel ID="UpdatePanel1" runat="server" ChildrenAsTriggers="False" UpdateMode="Conditional">
        <ContentTemplate>
            <asp:Label ID="lbl" runat="server">Updates in 5</asp:Label>
        </ContentTemplate>
       <Triggers>
         <asp:AsyncPostBackTrigger ControlID="Timer1" />
      </Triggers>
    </asp:UpdatePanel>
    

    Your VB code will look like this

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    
    End Sub
    
    Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs)
         lbl.Text = Date.Now.ToLongTimeString
    
    End Sub
    

    If this does not work you can manually call the Update() in the Timer_tick event

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm doing some fairly simple cross-platform TCP socket programming. I have unfortunately found out
I have a fairly simple layout with an image, and some textviews wrapped in
I am fairly new to Flotr2 and I have just been building some simple
I'm fairly new to scalaz and I've started out with validations. I have some
I'm having a very simple problem, which can be solved fairly simple but for
I have a slight problem with code here. I'm fairly new to it so
I am working in the .NET 2.0 framework. I have some code working, just
We have a couple of sites which have some memory problems and fairly often
I have bunch of strings, some of which are fairly long, like so: movie.titles
I have some code on two systems running kernel 2.4.20 and kernel 2.4.38 .

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.