Hello, I'm writing a order taking system using JQuery and ASP.NET. I'm also using JSGrid, which when provided with an array will display the data in a nice looking grid.
Within the project I'm using jquery.ajax and JSON to return various data as I need it. e.g. when the product code is entered I return a list of stock locations. Everything is working fine when adding a new order. But if I want to return to an existing order then I need to fill my javascript array with data, so that grid can be populated.
I could put a jquery.ajax request on the load event but this doesn't seem right - returning to the server to collect data after the page as loaded into the browser, it's a return trip for no reason, even if it is async.
Is there a way to send the order data to the javascript array when the page is first requested? I'm sure their must be, after all I'm sending the html and javascript, but I'm not sure which approach to use. ClientScript.RegisterClientScriptBlock from code behind appears promising. Is this a good route, or are there better ways?
What I have tried:
I've not tried much as I don't really know where to start. Looking for ideas and advice.