why asp.net dynamic charts are rendered only after the second page_load?

250 Views Asked by At

I am using web forms to develop a web application. From the very beginning, I have always been surprised by the page_load event being fired twice, and finally today I found out that all gridviews and texts are rendered after first page_load, and it takes another page_load to render all the dynamic asp.net charts..

why is it so, is there an attribute on the chart web server control that I can use to bypass this?

1

There are 1 best solutions below

0
On

Check to see if you "AutoEventWireup" set to true. If this is a control, check the parent control/page also. Even if the control itself is set to false, but the parent is set to true, it seems to fire anyway. Also check where you assign listener to Page_Load event:

this.Load += new System.EventHandler(this.Page_Load);

Should be in InitializeComponent method