Clock at run time

  • Thread starter Thread starter ruca
  • Start date Start date
R

ruca

How can I show a run time clock in my ASP .NET page???? Can anyone have any
code to show that?
I have a javscript file that have all necessary code for that, but I'm using
VB in my ASPX page and I can't use javascript like I'm using in my old ASP
page.
In old page I'm using both Vb and Java script. In ASPX I can't, right? How
can I solve this problem?
Can you help me????
 
ruca said:
How can I show a run time clock in my ASP .NET page???? Can anyone have any
code to show that?
I have a javscript file that have all necessary code for that, but I'm using
VB in my ASPX page and I can't use javascript like I'm using in my old ASP
page.
In old page I'm using both Vb and Java script. In ASPX I can't, right? How
can I solve this problem?
Can you help me????


--
Thanks (if you help me)
Hope this helps (if I help you)

ruca

A clock would run client-side. What sort of client script code you send to
the browser doesn't interest asp.net. So you can use either C# or VB.Net
(or one of the other .Net languages) server side, and still send javascript
client-side code.
So there should be no problem (unless I missed something ;-)

Hans Kesting
 
Hi Rico

Like this, your Javascript code has to be in the place between the brackets
of course
\\\
Dim str As String
str = "<script language=javascript> {window.open('http://www.google.com');}
</script>"
RegisterStartupScript("Startup", str)
///

I hope this helps a little bit?

Cor
 
Hi Cor,

But I have a file (named: liveclock.js), and in this file I have a function
that I need to call (named: show_clock()) to put a clock at run time in my
page.
Example of my page design:

Hour + Date : 09/01/2004, 16:37:35
User: XPTO
Pin: ******

in hour + date it wil be like this (run time):
09/01/2004, 16:37:35
09/01/2004, 16:37:36
09/01/2004, 16:37:37
09/01/2004, 16:37:38
09/01/2004, 16:37:39
.............
09/01/2004, 16:38:00
I have this way to call "show_clock()", but it's not working:

<script language=javascript src="liveclock.js"> show_clock() </script>

What I'm doing wrong????
 
Hi Ruca,

I did not test it, but I think just.

\\\
Dim str As String
str = "<script language=javascript> {show_clock();}
</script>"
RegisterStartupScript("Startup", str)
///
It puts the "str" in your load event and when your javascript already in
your page I think it will direct run after the page is loaded.

I hope it works?

Cor
 
Don´t work again or I don't put in right place.

I put that in my Page_Load function and not work.
Sorry boring again.

Where should I place that?


--
Thanks (if you help me)
Hope this helps (if I help you)

ruca
 
Forget!!!!!

After all it works. Thanks.

But can I put when I load that at the beggining of the page and not after
load.
The clock appears after loading all controls of my page and it must be the
first. :)


Thanks again (and again, and again, and again, ..., ..., ..., and again)
ruca
 
Back
Top