Click here to Skip to main content
15,921,884 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
Hi,

Is it possible to call Javascript function from asmx.cs file in webservice? If I google it, i'm getting results for 'Calling Webservice from Javascript'. What I need is exactly the opposite of this. 'Calling Javascript from Webservice'. Please share the info if anyone knows.

Thanks
Posted
Comments
[no name] 25-Aug-11 3:48am    
Your question is vague. Where is the JavaScript located? IMO, you cannot have JavaScripts in an asmx file.
Sunasara Imdadhusen 25-Aug-11 5:21am    
You can't call javascript from webservice. can explain in which scenario you would like to use?
Sergey Alexandrovich Kryukov 25-Aug-11 18:28pm    
Why on Earth?
--SA

Javascript language is predominantly used for Web development, on the client side only. There is a remote possibility to use what is called "Server-side Javascript".

See:
http://en.wikipedia.org/wiki/Server-side_JavaScript[^],
http://en.wikipedia.org/wiki/Comparison_of_server-side_JavaScript_solutions[^].

See also the Web references from these articles.

As far as I can see, Server-side Javascripts are quite exotic these days, as Javascript language, with all its flexibility, is a script language, not compilable one, it's hard to debug and on the server side it hardly can compete with modern powerful server-side technologies, such as ASP.NET or, say, Python, Ruby, etc. Even though I can imagine the use of Server-side Javascript in development of Web application, it's much harder to imagine what can you do with it for the development of the Web services which are not Web applications. However, such application do exist. Take a look at the first link I found:

http://net.tutsplus.com/tutorials/other/how-to-create-a-web-service-in-a-matter-of-minutes/[^].

I'm sure you will be able to find some more: http://lmgtfy.com/?q=%22server-side+javascript%22+%22Web+Service%22[^].

—SA
 
Share this answer
 
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900