|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Proper way to reload CompositeControl when its state must change after Postbackthe Table are controlled by an internal pager. The control renders the pager and the table. When the user clicks the pager, the control shows the next set of records in the table. Assume after the OnLoad method the control has regenerated to the exact state when the last time the page unloaded (with ViewState or some other means -- important part is the control's state is the same as when the page unloaded). Then the control changed events fire, then the post back events fire. A post back event is received from the Pager that the user requested a new page. So now the CompositeControl must "tear down" the old markup and regenerate the new markup. Is this as simple as calling Controls.Clear()? There must be more to it, b/c when I call Controls.Clear(), the Count becomes 0, and I create the new markup (in CreateChildControls). The Count property on Controls.Count shows new controls have been added, but when the page renders, the original markup is what displays. Thanks, John |
|||||||||||||||||||||||