showing changing time in a label

  • Thread starter Thread starter barry
  • Start date Start date
B

barry

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim curtime As Date
Do Until Date.Now >= some future date time
curtime = Date.Now
Label1.Text = curtime.ToString("hh:mm:ss:ff")
Loop
End Sub

Not sure how to get label1 to continuously show the change in time in a
webform. If this were windows you can use label1.refresh to give a stopwatch
running effect. Is there an equivalent syntax for asp.net or is javascript
needed?

thanks
 
thanks
Brock Allen said:
Use javascript, otherwise to change te label you'd have to post back to the
server, which is probabaly not what you want. So, use something like window.setInterval():
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top