protected void Button1_Click(object sender, EventArgs e) { chartproperty chprop = new chartproperty(); chprop.chartId = "myChart1"; chprop.chartType = "column3d"; chprop.chartWidth = "600"; chprop.chartHeight = "350"; chprop.xmlurl = "Data/maindata.json"; chprop.renderId = "Label1"; List<chartproperty> listofchart = new List<chartproperty>(); listofchart.Add(chprop); foreach (var item in listofchart.Select((x, i) => new { Value = x, Index = i })) { // calling javacript function passing all chart properties. ScriptManager.RegisterStartupScript(UpdatePanel1, UpdatePanel1.GetType(), "codeMethod" + item.Index + "", "chartMethod('" + item.Value.chartId + "','" + item.Value.chartType + "','" + item.Value.chartWidth + "','" + item.Value.chartHeight + "','" + item.Value.xmlurl + "','" + item.Value.renderId + "');", true); } }
protected void Button1_Click(object sender, EventArgs e) { chartproperty chprop = new chartproperty(); chprop.chartId = "myChart1"; chprop.chartType = "column3d"; chprop.chartWidth = "600"; chprop.chartHeight = "350"; chprop.xmlurl = "Data/maindata.json"; chprop.renderId = "Label1"; List <chartproperty> listofchart = new List <chartproperty>(); listofchart.Add(chprop); foreach (var item in listofchart.Select((x, i) => new { Value = x, Index = i })) { // calling javacript function passing all chart properties. ScriptManager.RegisterStartupScript(UpdatePanel1, UpdatePanel1.GetType(), "codeMethod" + item.Index + "", "chartMethod('" + item.Value.chartId + "','" + item.Value.chartType + "','" + item.Value.chartWidth + "','" + item.Value.chartHeight + "','" + item.Value.xmlurl + "','" + item.Value.renderId + "');", true); } }