Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 02-24-2005, 06:07 AM   #1 (permalink)
dianne
Registered User
 
Join Date: Feb 2005
Posts: 6
dianne is on a distinguished road
Calling a .aspx function to javascript

how can i call a function from .aspx to my javascript?
please help...
dianne is offline   Reply With Quote
Old 02-24-2005, 07:04 AM   #2 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,532
sde is on a distinguished road
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
sde is offline   Reply With Quote
Old 02-24-2005, 07:39 AM   #3 (permalink)
dianne
Registered User
 
Join Date: Feb 2005
Posts: 6
dianne is on a distinguished road
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.
dianne is offline   Reply With Quote
Old 02-24-2005, 07:41 AM   #4 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,532
sde is on a distinguished road
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
sde is offline   Reply With Quote
Old 02-24-2005, 08:15 AM   #5 (permalink)
dianne
Registered User
 
Join Date: Feb 2005
Posts: 6
dianne is on a distinguished road
ah ok... thanks so much!
dianne is offline   Reply With Quote
Old 04-01-2005, 04:50 AM   #6 (permalink)
praveen
Registered User
 
Join Date: Apr 2005
Posts: 2
praveen is on a distinguished road
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
praveen is offline   Reply With Quote
Old 04-01-2005, 04:52 AM   #7 (permalink)
praveen
Registered User
 
Join Date: Apr 2005
Posts: 2
praveen is on a distinguished road
__doCallback('_Converter',message,ShowServerTime,c ontext,OnError)
praveen is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Javascript Function jcramer83 HTML, XML, Javascript, AJAX 5 04-14-2003 07:12 AM
javascript function help.. Admin HTML, XML, Javascript, AJAX 2 03-09-2003 07:35 PM
trouble calling auxiliary function in a class brtklt Standard C, C++ 0 07-18-2002 06:22 PM


All times are GMT -8. The time now is 12:23 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0 RC8 ©2007, Crawlability, Inc.





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting