Stopwatch / Countup in VB.NET

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • fightclub777
    New Member
    • Jul 2007
    • 1

    #1

    Stopwatch / Countup in VB.NET

    Hi, I've done some reasearch to be able to find the best way of acheiving this, but have been unlucky so far.

    What I'm trying to do is create a stopwatch on a .net page, whereby when a user clicks the "start" button, the timer begins to count up and displays a real-time timer (I'd prefer an Ajax method) to avoid postbacks. The start time will also be saved to the databse.

    Upon clicking stop, the timer will display the elapsed time and save the stop time in the database as well.

    I have no problems achieving any of the above, except for displaying the "count up" timer in a ajax/javascript way, so that the page is not refreshing and a smooth timer is displayed.

    I've achieved the complete sceanrio using the AJAX Timer control, but it does not provide the visual feel that I'm looking for. The display updates, but not smoothly, and the status bar on the window keeps refreshing based on the interval I had set. Any help would be greatly appreciated.
  • kenobewan
    Recognized Expert Specialist
    • Dec 2006
    • 4871

    #2
    I believe that the only way for this to work, as you have discovered, is for page to refresh client side or round trip to the server. There are ways to not get the rest of the page to refresh, eg inside something else. Another idea possibly animated image to display time passing when time started, then image not visible when time stops and label gives the result. For - page only refreshes twice. Cons - animated images can be large files. HTH.

    Comment

    Working...