After performing a query in the code behind and storing the value in a hidden field, I am wondering how to pass that same value to Javascript without using session variables, as they do not update on partial page load.
This is the code snippet I currently have:
<script type="text/javascript">
google.load("visualization", "1", { packages: ["corechart"] });
google.setOnLoadCallback(drawChart);
//Draw a pie
function drawChart() {
var data = new google.visualization.DataTable();
data.addColumn('string', 'Task');
data.addColumn('number', 'Hours per Day');
data.addRows(4);
data.setValue(1, 0, 'Not Received');
data.setValue(1, 1, Value1);
data.setValue(2, 0, 'Received');
data.setValue(2, 1, Value2);
data.setValue(3, 0, 'Read');
data.setValue(3, 1, Value3);
var chart = new google.visualization.PieChart(document.getElementById('chart_div'));
chart.draw(data, { width: 450,backgroundColor:'#DCDCDC', height: 300, title: 'Message Status' });
// to draw a bar
var progress1 = new RGraph.VProgress('progress1', Value4, 100);
progress1.Set('chart.colors', [Value5]);
progress1.Set('chart.tickmarks', false);
progress1.Set('chart.margin', 3);
progress1.Set('chart.tickmarks.inner', false);
progress1.Set('chart.label.inner', true);
progress1.Set('chart.gutter.left', 20);
progress1.Set('chart.gutter.right', 40);
progress1.Set('chart.tickmarks', true);
progress1.Set('chart.units.post', '%');
progress1.Draw();
}
I need to find a way to pass the value from the hidden field to the last line. Can you provide me with some example code for this?