Welcome to WebmasterWorld Guest from 3.92.92.168

Forum Moderators: ocean10000

Message Too Old, No Replies

Timer update

timer not updating label

     

core_fate

5:46 pm on Mar 21, 2005 (gmt 0)

Inactive Member
Account Expired

 
 


Hello all,

I had made a small test application to have a timer update a label every 2 seconds, and even tho in debug mode I can see that the elasped event IS hit the label is NOT updated. I have a button that sets the timer.enabled to true, and when I put a breakpoint in the code there, the label DO get updated every time I click that button. Do anyone have similar problems? Thanks!

CF

6:51 pm on Mar 23, 2005 (gmt 0)

Full Member

10+ Year Member

joined:Feb 19, 2004
posts:207
votes: 0


I'm not sure, but it sounds to me like you want a web page to behave like a windows document. A web page showing in your browser is not connected to the server once the page loads. Anything the server does will not show in the page until the next http request. So a label being changed by a timer in the server won't affect the web page until the next request.

In asp.net, your enable timer button posts back to the server and makes a new request. I thinks that is why you see the label updated.

I don't know any way to make dynamic server actions show on a web page without a request from the browser. You generally need the client side to do that for you.

7:17 pm on Mar 23, 2005 (gmt 0)

Full Member

10+ Year Member

joined:May 15, 2002
posts:236
votes: 0


You can use meta refresh tag and put your code in onload event
<meta http-equiv="refresh" content="20;url=http://www.sample.com">
1:31 am on Mar 24, 2005 (gmt 0)

Full Member

10+ Year Member

joined:Feb 19, 2004
posts:207
votes: 0


The meta refresh tag causes the browser to issue an http request for the specified url after the specified delay time.

You could use it to check how your timer is working. But it still involves a new http request each time and a reload of the page with the new values in the html code at the instant the page was sent by the server.

Some people have said it is works for things like stock tickers. I never tried it for that. I see lots of discussion about using it to redirect, and what the search engines think about it.