I am working on an ASP.NET/C# site.
I am reading data from a database, storing it in a dictionary
Dictionary<string, decimal> Results
and then linking it to an ASP.NET diagram
PieChart.Series["Series"].Points.DataBind(Results, "Key", "Value", string.Empty);
I want to change the point label when I click the button.
protected void Button_Click(object sender, EventArgs e) { PieChart.Series["Series"].Points[0].Label = "abc" }
But the problem is, when I click the button, a PostBack appears, and the data stored in the Dictionnary "Results" is lost, as well as the Chart.
Is there a way, rather than losing data, when a postback occurs without re-reading from the database?
Thanks for any help.
Youssef
source share