You're mixing up server-side and client-side here. An ASP.Net Page has two
different and separate parts to it. One is the server-side code that
generates the HTML in the other, which is the client-side document. Your
code is server-side code. The server-side class lives for a matter of
milliseconds, long enough to generate the HTML that is sent to the browser.
Your timer will never fire. What I would suggest is doing the same thing,
but on the client-side, using JavaScript.
--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
"vickey" <vi********@yahoo.com> wrote in message
news:f7**************************@posting.google.c om...
Hi,
Im trying to make a page which refreshes by itself.For that i have added a
timer with following properties:
Autoreset = true
Enabled = true
interval = 30000
Name = timer1
on timer1_elapsed i have added the following code:
Private Sub Timer1_Elapsed(ByVal sender As System.Object, ByVal e As _
System.Timers.ElapsedEventArgs) Handles Timer1.Elapsed
Label2.Text = "time is: " + Now.ToString
End Sub
But this does not result in label showing current time after its been
loaded. Any idea why? Also how can i make it work?
Thanks
vickeybird