469,287 Members | 2,785 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,287 developers. It's quick & easy.

javascript calling asp function

How can I call asp function from javascript?

Oct 13 '05 #1
2 6661
Sehboo wrote:
How can I call asp function from javascript?

"javascript"? I assume you mean "client-side code", which can be written in
other script languages besides javascript, depending on browser support ...
Since this is a client-side question, it's offtopic for this newsgroup. You
should post any followup questions to an appropriate group such as

Anyways, the answer is:
By requesting the page containing the function from the server.

There are several techniques via which this can be accomplished: img
elements, iframes, remote scripting, xmlhttprequest. The technique you use
depends on whether you need to receive a value back from the server-side

Bob Barrows
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Oct 13 '05 #2
Don't know if this might give you any ideas.

JavaScript function with an ASP variable.
Response.Write "<script type='text/javascript'>alert('" &
strMyASPVariable & "');</script>"

JavaScript function with hardcoded text:
Response.Write "<script type='text/javascript'>alert('Yet to be

Best regards,
J. Paul Schmidt, Freelance Web and Database Developer
Access Database Sample, Web Database Sample, ASP Design Tips

*** Sent via Developersdex http://www.developersdex.com ***
Oct 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

10 posts views Thread by JohnS | last post: by
4 posts views Thread by Martin Feuersteiner | last post: by
16 posts views Thread by Roman Ziak | last post: by
20 posts views Thread by shapper | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.