473,322 Members | 1,408 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

any reason why this code example wont work?

Hi there,

i have 2 pages: default.aspx and getTime.aspx

1. getTime.aspx has one line: "response.write(datetime.now())"
2. default.aspx has the following html code: "<script type="text/javascript"
src="getdate.aspx"></script>"

When i run it it does nothing except return me a javascript error saying:
Line 2, Char 12, Expected ";".. which i have got no idea here as i've only
typed in 1 response.write line.

any help appreciated,
thanks,
Paul
Apr 3 '07 #1
4 1961
On Apr 3, 9:01 am, "Milsnips" <milsn...@hotmail.comwrote:
Hi there,

i have 2 pages: default.aspx and getTime.aspx

1. getTime.aspx has one line: "response.write(datetime.now())"
2. default.aspx has the following html code: "<script type="text/javascript"
src="getdate.aspx"></script>"

When i run it it does nothing except return me a javascript error saying:
Line 2, Char 12, Expected ";".. which i have got no idea here as i've only
typed in 1 response.write line.

any help appreciated,
thanks,
Paul
Hello Paul:
You are just saying to getTime.aspx "hey, show me the current time".
And in the other, you are just referencing a javascript source file
that does'n exist, cause default.aspx is at least html code, not
javascript. What are you trying to do?
Oscar

Apr 3 '07 #2
Ok what i'm trying to do is use the server side DateTime class to get the
UTC time and display it on the page. I've tried it in javascript, but it
isnt giving me the results i'm after as javascript works on the local pc and
if the time is incorrect, it will show incorrectly.

So all i want to do is call the getTime.aspx via the <scripttag and in its
place write out the time.

thanks,
Paul
"Cubaman" <os******************@googlemail.comwrote in message
news:11*********************@q75g2000hsh.googlegro ups.com...
On Apr 3, 9:01 am, "Milsnips" <milsn...@hotmail.comwrote:
>Hi there,

i have 2 pages: default.aspx and getTime.aspx

1. getTime.aspx has one line: "response.write(datetime.now())"
2. default.aspx has the following html code: "<script
type="text/javascript"
src="getdate.aspx"></script>"

When i run it it does nothing except return me a javascript error saying:
Line 2, Char 12, Expected ";".. which i have got no idea here as i've
only
typed in 1 response.write line.

any help appreciated,
thanks,
Paul

Hello Paul:
You are just saying to getTime.aspx "hey, show me the current time".
And in the other, you are just referencing a javascript source file
that does'n exist, cause default.aspx is at least html code, not
javascript. What are you trying to do?
Oscar

Apr 3 '07 #3
In the example you gave you are reference a page that contains server side
code as if it were a javascript file...

The simplest way to do this would be likely to just create a server side
control (such as a label) and initialize it with the UTC time on the server.

Try :
http://quickstarts.asp.net/QuickStar...x#manipulating

---
Patrice

"Milsnips" <mi******@hotmail.coma écrit dans le message de news:
%2****************@TK2MSFTNGP03.phx.gbl...
Ok what i'm trying to do is use the server side DateTime class to get the
UTC time and display it on the page. I've tried it in javascript, but it
isnt giving me the results i'm after as javascript works on the local pc
and if the time is incorrect, it will show incorrectly.

So all i want to do is call the getTime.aspx via the <scripttag and in
its place write out the time.

thanks,
Paul
"Cubaman" <os******************@googlemail.comwrote in message
news:11*********************@q75g2000hsh.googlegro ups.com...
>On Apr 3, 9:01 am, "Milsnips" <milsn...@hotmail.comwrote:
>>Hi there,

i have 2 pages: default.aspx and getTime.aspx

1. getTime.aspx has one line: "response.write(datetime.now())"
2. default.aspx has the following html code: "<script
type="text/javascript"
src="getdate.aspx"></script>"

When i run it it does nothing except return me a javascript error
saying:
Line 2, Char 12, Expected ";".. which i have got no idea here as i've
only
typed in 1 response.write line.

any help appreciated,
thanks,
Paul

Hello Paul:
You are just saying to getTime.aspx "hey, show me the current time".
And in the other, you are just referencing a javascript source file
that does'n exist, cause default.aspx is at least html code, not
javascript. What are you trying to do?
Oscar


Apr 3 '07 #4
And, specifically, the VBControls2.aspx example :

Page:
http://quickstarts.asp.net/QuickStar...trols2_vb.aspx

Source:
http://quickstarts.asp.net/QuickStar.../controls2.src

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Patrice" <http://www.chez.com/scribe/wrote in message
news:uG**************@TK2MSFTNGP05.phx.gbl...
In the example you gave you are reference a page that contains server side code as if it were a
javascript file...

The simplest way to do this would be likely to just create a server side control (such as a label)
and initialize it with the UTC time on the server.

Try :
http://quickstarts.asp.net/QuickStar...x#manipulating

---
Patrice
"Milsnips" <mi******@hotmail.coma écrit dans le message de news:
%2****************@TK2MSFTNGP03.phx.gbl...
>Ok what i'm trying to do is use the server side DateTime class to get the UTC time and display it
on the page. I've tried it in javascript, but it isnt giving me the results i'm after as
javascript works on the local pc and if the time is incorrect, it will show incorrectly.

So all i want to do is call the getTime.aspx via the <scripttag and in its place write out the
time.

thanks,
Paul
"Cubaman" <os******************@googlemail.comwrote in message
news:11*********************@q75g2000hsh.googlegr oups.com...
>>On Apr 3, 9:01 am, "Milsnips" <milsn...@hotmail.comwrote:
Hi there,

i have 2 pages: default.aspx and getTime.aspx

1. getTime.aspx has one line: "response.write(datetime.now())"
2. default.aspx has the following html code: "<script type="text/javascript"
src="getdate.aspx"></script>"

When i run it it does nothing except return me a javascript error saying:
Line 2, Char 12, Expected ";".. which i have got no idea here as i've only
typed in 1 response.write line.

any help appreciated,
thanks,
Paul

Hello Paul:
You are just saying to getTime.aspx "hey, show me the current time".
And in the other, you are just referencing a javascript source file
that does'n exist, cause default.aspx is at least html code, not
javascript. What are you trying to do?
Oscar



Apr 3 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

242
by: James Cameron | last post by:
Hi I'm developing a program and the client is worried about future reuse of the code. Say 5, 10, 15 years down the road. This will be a major factor in selecting the development language. Any...
15
by: Bryan | last post by:
I have a multi-threaded C# console application that uses WMI (System.Management namespace) to make RPC calls to several servers (600+ ) and returns ScheduledJobs. The section of my code that...
3
by: Lenn | last post by:
Hello, I have the following example of AsyncCallback from a C# book which I wanted to implement in my project: //Class with AsyncDelegate public class AsyncProcess { public AsyncProcess() {
2
by: Eidolon | last post by:
Heres what i am trying to do: In the codebehind code for a page, i want to be able to send the request on to another page, but with different form values than what may have been submitted to me....
2
by: Cleverbum | last post by:
Hi, been scratching my head for a while on this one and was wondering how what was going wrong. I dont mind at this stage if the actual thing I'm trying to do, just why on earth it wont accept...
16
by: Rex | last post by:
Hi All - I have a question that I think MIGHT be of interest to a number of us developers. I am somewhat new to VIsual Studio 2005 but not new to VB. I am looking for ideas about quick and...
66
by: Jon Skeet [C# MVP] | last post by:
I'm sure the net will be buzzing with this news fairly soon, but just in case anyone hasn't seen it yet: Microsoft are going to make the source code for the .NET framework (parts of it,...
10
by: _Who | last post by:
Given Request.Cookies and Response.Cookies in asp.net is there any reason to ever use javascript or any other method to use cookies? Thanks
0
by: sourpo | last post by:
wonder if anyone can help... I have access db with a whole lot of vb code... If i use access 2000 it works perfectly but when using 2003 it doesn't work properly. The db copies outlook mailboxes......
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.