Click here to Skip to main content
15,995,072 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi
I need to call server side function from client side java script.

Thanks.
Posted

You cannot call server-side code "directly" from client-side code. Try AJAX
 
Share this answer
 
v2
Comments
deepak chaudhari snk 15-Sep-12 8:10am    
i am not calling server side function from java script please give me sample for calling server side function from java script.
Kuthuparakkal 15-Sep-12 8:59am    
follow: http://www.aspsnippets.com/Articles/Calling-server-side-function-from-JavaScript-in-ASP.Net.aspx
you want to know how to talk to server from Javascript.
There are few ways to interact with server side through client side(Javascript):
1. XMLHttpRequest[^]
2. Callback[^]

If ASP.NET, following too are an option:
3. WebService call[^]
4. PageMethod[^]


In general, XMLHttpRequest via jQuery would be best bet:
Here, have a look:
http://api.jquery.com/jQuery.ajax/[^]
http://api.jquery.com/category/ajax/[^]
http://www.w3schools.com/jquery/jquery_ref_ajax.asp[^]


Pick the one that suits you best.
 
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