I have a Chart on a web page. I have few Buttons as well. One of the buttons is to bind data to the chart. And I have a dropdownlist to have different options to load the data and bind the chart.
If I click on other buttons on the page, the page postbacks and the chart become blank. So I googled and added EnableViewState="True" to the Chart. Now I can click on other buttons and on postbacks, the chart is still there. Great.
But when I choose a different item from the dropdownlist and click on the button that do the chart binding, there was an error. I know it is because I set EnableViewState property of the chart to True and there are already data on the chart so the chart won't let me bind data again.
So I tried to set Chart1.ViewStateContent = Nothing on the button click of the button that bind data to the chart. That failed as well. The error is Illegal enum value: 0.
So how to make that work ?
thanks ...