I am trying to pass a JavaScript Object with multiple values of bootstrap chart data from C# Code Behind to JavaScript code in aspx page .. I have write the following code but no chart appear and it gives me a JavaScript error.
protected void Page_Load(object sender, EventArgs e)
{
// Chart
LineChartData.Value = GetLineChartData();
// LineChartData is a hidden input control at aspx page
}
}
I found the problem .. it is the format of JSON string it should enclosed with double quotes.. and string must be converted to JSON object at the javascript code ... This example of how to pass JSON string and then convert it to JSON object...
Member
17 Points
69 Posts
Passing JavaScript Object from Code Behind to JavaScript code in aspx page
Jan 05, 2019 01:01 AM|alghrib|LINK
Hello everyone..
I am trying to pass a JavaScript Object with multiple values of bootstrap chart data from C# Code Behind to JavaScript code in aspx page .. I have write the following code but no chart appear and it gives me a JavaScript error.
at page.aspx the following code:
Hope anyone can help me to solve this problem ...
the javascript error saya:
Everthing is possible
Member
17 Points
69 Posts
Re: Passing JavaScript Object from Code Behind to JavaScript code in aspx page
Jan 05, 2019 07:42 PM|alghrib|LINK
I found the problem .. it is the format of JSON string it should enclosed with double quotes.. and string must be converted to JSON object at the javascript code ... This example of how to pass JSON string and then convert it to JSON object...
Everthing is possible