I am trying to avoid a composite control or use and ASCX by extending an existing control. However, I am having problems adding controls to an inherited control and maintaining their presentation / state integrity after feedback. Whenever I add controls during pre-rendering, the controls are displayed, but post-back throws a viewstate exception. I tried to add them both there and during LoadViewState (which, of course, was stupid stupid). Init is not accessible from the control that I am expanding.
The exception is Sys.WebForms.PageRequestManagerServerErrorException: Failed to load viewstate. The control tree in which the loaded one should correspond to the control tree that was used to save the viewstate during the previous request. For example, when dynamically adding controls, controls added during feedback must match the type and position of controls added during Request
source
share