All
I am having with what appears to be a ASP.NET page life cycle issue. I currently have a user control embedded into my page. Now depending on the options chosen from the menu item list, the page can be in one of three states represented by a PageStates Enum within the control. The page on selecting the menu item merely updates the a property exposed from the control
- Initial State (nothing congifurable)
- Editing (this uses a dropdown extender and makes a gridview within it visible)
- Adding (this uses another dropdown extender and makes the same the gridview visible however with different properties)
PROBLEMS
- The page will only get itself into the correct 'state' if the menu item is selected twice
- Controls are visible on the gridview when they shouldn't be
- The page 'state' seems to lag one state behind
I think the main problem I having with this is that the grid view has check boxes drawn if the page is Adding mode, however you would need to select the Adding menu item option twice to get it into this state and I believe it is because I am setting the page state when the menu item is selected however the grid rows are already created at this point ( I am dynamically creating the check boxes in the grid view within the RowCreated event
Does anyone have any suggestions as to how I get round this problem? Can this implementation ever work?