0

How can I pass a DataTable element with a lot of rows, to Javascript ?

The idea is to allow me do a loop in my variable that receive this DataTable and recover the values.

Lucas_Santos
  • 4,638
  • 17
  • 71
  • 118

1 Answers1

3

Json is the best option here, but you're going to run into complexity if you're using anything but simple types.

Ryan Amies
  • 4,902
  • 1
  • 21
  • 36
  • Who tells you, that this needs an extra http-request? Perhaps the informations are already present before delivering the html? – Christoph Jul 03 '12 at 14:13
  • You can include the Json in the same request, but to parse it back on the server side you'll need to post it. Presuming he doesnt want to save each value at a time then it would be best to bundle up the results in Json and then process them on the server. – Ryan Amies Jul 03 '12 at 14:18