Because before the WM Group made a delivery dashboard, about 3 weeks time,. NET also forget almost, Ajax and Highchart table is also learning, pretty laborious! Finally, I got it. Post a record.
1. foreground aspx page <Javascript> (the following AJAX code can be present and triggered in a JS event, which is included in the event code)
$.getjson ("Handler4.ashx", {"param": A, "param1": B}, function (data) {$.each (data, function (I, item) { bar_version. Push (item["version"]); Bar_value.push (item["Vamount"]); $.each (item, function (k, v) { }); });
Param and param1 Pass the values of A and b into the background.
2. Ashx.cs-handler
string param = httpcontext.current.request["param"];
Pass the Param value into the handler CS background and serialize a list parameter JSON (using the Newtonsoft package)
stringStrjson = Newtonsoft.Json.JsonConvert.SerializeObject (_list);
Context. Response.Write (Strjson);
For more information about Newtonsoft:
Http://www.newtonsoft.com/json
3. incoming background JSON data to the foreground
$.getjson ("Handler4.ashx", {"param": A, "param1"function (data) {// The Red data variable is a variable Strjson function from the background JSON format ///through each function, the JSON-formatted data is read out. Bar_version.push (item["version"]); Bar_value.push (item["Vamount"]); function ( K, v) { }); });
:
Asp.net&ajax&json-Dynamic Read data