Call a server side function from JavaScript!!!

  • Thread starter Thread starter Stephen
  • Start date Start date
S

Stephen

Hi,

In a form, can we have a client script to call a server side code... what I
am try to say is:

Suppose I have a form with a text box and a button, is it possible to write
a client script (JavaScript) that will call a Code behind function?

Please advice,
Stephen
 
I don't believe you can do that, at least not directly. You'd have to post
back to the server somehow to initiate the call. Maybe set a hidden form
field with a value and then your codebehind can watch for that value and make
the call.
 
Sorta.. You can use Webservice behaviors (look for it on MSDN) to do client
requests to Server side SOAP APIs.

If you can use .NET 2.0 for this, there are lightweight callback mechanisms
in it for this kind of work.
 
Back
Top