Results 1 to 4 of 4

Thread: current time shows on web form

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2003
    Posts
    108

    current time shows on web form

    Does anybody know how to make the current time shows on the web form (WebForm1.aspx)?

    I have tried the following code: label1.text = TimeofDay. And it did show on the form "example: 9:50:52 PM", but it stays the same and will not show the new time until the form reloads again. In other words, the time is not alive. I'd like to see the second interval ticking.

    any idea, anyone?

    P.S: Time function (Label1.Caption = Time) will not work on the web form, it only works on VB6 desktop app.

    Thanks.

  2. #2
    Frenzied Member DevGrp's Avatar
    Join Date
    Nov 2001
    Location
    Charlotte, NC
    Posts
    1,256
    You are gonna have to use JavaScript for that to work like that.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jan 2003
    Posts
    108
    You mean there is no way that can done in VB.NET. Even if we use Timer component?

    Hummmm.

  4. #4
    Fanatic Member pax's Avatar
    Join Date
    Mar 2001
    Location
    Denmark
    Posts
    840
    The only way to do this in net is to reload the page at a certain interval, which is not very userfriendly.

    You can't make this serverside.

    As DevGrp said, you need JavaScript or VBScript to do this.

    Make a <DIV ID="MyClock">x</DIV> or simliar.
    In a timerevent in Java or VBS you can user the MyClock.InnerHTML=WhateverTheTimeSyntaxIsForYouSelectedLanguage

    I'm not able to test this, but I think this should be enough to push you in the right direction.
    I wish I could think of something witty to put in my sig...

    ...Currently using VS2013...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width