|  | |  |
02-24-2005, 06:07 AM
|
#1 (permalink)
| | Registered User
Join Date: Feb 2005
Posts: 6
| Calling a .aspx function to javascript how can i call a function from .aspx to my javascript?
please help...  |
| |
02-24-2005, 07:04 AM
|
#2 (permalink)
| | Moderator
Join Date: May 2002 Location: us.ca
Posts: 4,532
| hi dianne, welcome to the site.
it is not possible. javascript runs client side, and asp .net functions run server side.
what does this mean .. .aspx pages are generated on the server dynamically and then send out the web page to the client. ( including javascript )
once the page is served, then javascript runs in the client's browser.
__________________ Mike |
| |
02-24-2005, 07:39 AM
|
#3 (permalink)
| | Registered User
Join Date: Feb 2005
Posts: 6
| oh i see... thanks for the info.  anyway, how can i put this into javascript code that if the user will press the enter key, it will go to another statement. |
| |
02-24-2005, 07:41 AM
|
#4 (permalink)
| | Moderator
Join Date: May 2002 Location: us.ca
Posts: 4,532
| well i'll assume that getFlightTime() is being pulled from a database, .. so you will probably have to just submit the page and do it all server-side.
i haven't done a whole lot of c#/asp programming, .. but if i remember correctly, you can use If(IsPostBack) in the page load function. if it results in true, then i think you could then use the logic you have above.
the difference is the page will refresh as opposed to executing client side like javascript.
i'm typing from memory as i haven't coded c# very much with asp.net. you may want to google IsPostBack for examples of how others process forms server side with c#.
__________________ Mike |
| |
02-24-2005, 08:15 AM
|
#5 (permalink)
| | Registered User
Join Date: Feb 2005
Posts: 6
| ah ok... thanks so much!  |
| |
04-01-2005, 04:50 AM
|
#6 (permalink)
| | Registered User
Join Date: Apr 2005
Posts: 2
| Quote: |
Originally Posted by dianne how can i call a function from .aspx to my javascript?
please help...  |
__doCallback('function ' ,message,ShowServerTime,context,OnError)
in this way u can call a server side function in java script |
| |
04-01-2005, 04:52 AM
|
#7 (permalink)
| | Registered User
Join Date: Apr 2005
Posts: 2
| __doCallback('_Converter',message,ShowServerTime,c ontext,OnError) |
| | | Thread Tools | | | | Display Modes | Linear Mode |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | | All times are GMT -8. The time now is 12:23 AM. |
Copyright © 2000-2008, Milano Interactive Web Hosting provided by Portal 360 Web Hosting |  | |