But, since jQuery effect takes some time to finish the next line code may execute while the previous effect is still running. Uncaught ReferenceError: updateErrorMessage is not defined Solution. To prevent this from happening jQuery provides a callback function for each effect method. Uncaught ReferenceError: updateErrorMessage is not defined Solution. You just need to call only the function and the code gets executed automatically when required. As almost everything we do when using jQuery reads or manipulates the document object model (DOM), we need to make sure that we start adding events etc. Now here in this tutorial, I’ll explain how to call server-side function using jquery ajax call from .aspx page as well as how to call code-behind method in c# or vb.net with example code.. To call code-behind function or method with parameters from jquery ajax, we need to use following function on and bind it on button click event using jquery: Calling a JavaScript library function is quite easy.