Saturday, March 24, 2012

Maintaining State when using multiple Custom controls in one page

Hi All,
I have a customizable Dashboard, which displays more than 1 user controls.
For ex:
User Control 1 : Sales Pie Chart Report with-in Date range as user input (Start and End Dates).
User Control 2 : Top 5 Customer Bar Chart Report with Date range as user input (Start and End Dates).
User Control 3 : Daily Sales report with Date parameter as user input.
I have problem maintaining the state of the users control values . Letz say I pick Start and End Dates for Usercontrol 1 and populate the graph. On selection of dates for the 2nd user control, I loose state in User Control 1 (it goes back to the initial state with no data).
Appreciate your help.

Have you set enableviewstate=false for any of the controls or the controls within them? Does you code run within page load without checking for a post back?


I have not set enableviewstate=false to controls inside the usercontrols. I am checking for IsPostback in the pageload.
Strange. If you wish send me your code or post it.

0 comments:

Post a Comment