Click here to Skip to main content
15,921,174 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i want to call a code behind method using jquery on the button on click event.
for example if i click on a button then it calls a jquery function then Jquery method call the server side method.

please advise.
Posted
Comments
Cenarjun 14-Jan-14 2:11am    
post the jquery code..

You cannot "call" it, because Javascript works on the client side; and the code-behind is on the server side. Nothing happens on the server side until you send some HTTP request. So, you can get some data from the server side only if you send HTTP request and receive some HTTP response. From your Javascript function, you cannot use the Web form (which you may not have), so the only way to send such request if Ajax:
http://en.wikipedia.org/wiki/Ajax_(programming)[^].

One convenient way to use Ajax is using jQuery Ajax: http://api.jquery.com/jquery.ajax[^].

—SA
 
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