Moving a widget causes the loss of state

Jan 7, 2010 at 2:13 PM

I have a widget in which i am using a chart control.

I am binding the chart control in the Page_Load of the widget.

 protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            BindDropdown();
            CreateChart();
        }
    

 

 protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            BindDropdown();
            CreateChart();
        }
    }

 

 

Initially chart shows up correctly. 

Now, when I drag the widget and place it in some other place holder the chart loses its data.

I don't want to bind the chart on every page load because then, just for moving a widget, I will be paying high performance penalty.