Hi!
Many of you on any moment will need call a function on the server side, may be to get data from the database, or do something that you can't do on the client side. I'll try to explain how you can do that on ASP .net using Visual Basic .net
First, you'll need a reference to AJAX on you project. All that you need for that, you can find in this site:
http://www.asp.net/ajax/downloads/When you finally made the reference to AJAX, we'll start to programing.
First, on your code, on the event Page_Load, you need add this line:
take note that you replace *class* for the name of the class that you are using.
example
Later do the function that you will need call from javascript.. I will make a 'Hello World function'

now, when you make a function to call from javascript, you'll need add the reference to javascript on the function, so the helloWorld function will be like that:
And Finish.... this is all that you need on the server side... go now to the client side, to the javascript code...
I'll make a javascript function to alert what return my VB function...
If you see, you need to send by parameter, the name of the function that will catch what return the VB function, we'll need to create that function:
who you can see, this function get response by parameter, on this variable is the data that the server send, if exist any problem, response.error will have the description of the error, but if response.error is empty, on response.value is the value responded by the server.
And that's it... this is all that you need to call a function on the server side from a javascript function on the client side... You need to know that exist a little delay between the request and the response, so, you need to think how to management that delay.
Any questions, post on this topic.
Ciao
