Jay
Jay

Reputation: 21

Simple server and client request/response in C#

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?

Upvotes: 2

Views: 1696

Answers (2)

RickNZ
RickNZ

Reputation: 18654

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.

Upvotes: 0

Related Questions