NASRIN
NASRIN

Reputation: 499

Pass data from server to client

I fill a dimensional array in a function (server-side) then Client has to allow for saving data.

How can I pass this array to client and then to server? This array maybe too large and I can’t add it in session.

List<List<string>> friend = new List<List<string>>();

Upvotes: 0

Views: 439

Answers (1)

Pantelis Natsiavas
Pantelis Natsiavas

Reputation: 5369

You have to remember that when you use HTTP, the client requests and the server responds. No matter what paradigm you use (eg ajax) this will be what actually happens under the hood. So there is no way for the server to cause an action, if the client does not initiate it.

I would suggest to setup a REST endpoint and then call it from the client using javascript. This REST endpoint could return data, in a format that the clilent would understand and could display. Usually, data are being transfered using the JSON format. The client, could then make a second REST request, sending the JSON data back to the server.

Perhaps this tutorial could help you.

Hope I helped!

Upvotes: 1

Related Questions