views:

226

answers:

2

OK. I just want to know if this can be done.

I'm using C# asp.net language.

I want to send a structure to a webserver from a webpage (much like you you can pass a structure to a function). The server would act on the data found in the structure, and then return back the structure (with its contents modified) to the "client" webpage. The webpage would then, based on the data received, do a particular task.

is it possible that information be passed between webpages & servers just like functions? If not, is there any way that i may be able to accomplish what was said above?

+3  A: 

Answer is yes, you can try calling a server-side function from a client-side script.

Here are a few good reads:
Client-Side Web Service Calls with AJAX Extensions
Client Side Callbacks in ASP.NET 2.0
Extend ASP.NET AJAX Client-Side Function - The Server-Side Way
ASP.NET 2.0 Client-Side Features: Bring Server-Side Power to the Client

o.k.w
thanks man. prompt answer!
Jay
7min from the question asked to the 1st answer posted ain't exactly prompt, but thanks anyway. It's weekend :P
o.k.w
A: 

Sure. You can encode your structure in a string, and then send it to the server as a query string or in a form POST, using either a dedicated link or plain JavaScript or Ajax (XMLHTTP). When the response arrives, you can similarly decode it with JavaScript and then take whatever action is appropriate.

There are several libraries to help automate this kind of thing, including XML-RPC.

RickNZ