createchildcontrols

Why clear controls in CreateChildControls

All of the examples of ASP.NET composite controls always clear child controls as the first action within CreateChildControls. Why is this? As I understand it this method is always called via EnsureChildControls which sets a flag to indicate that it has already been called and thus does not call CreateChildControls again. Is CreateChildC...

SharePoint AJAX implementation: ScriptHandler being added twice

I am currently in the process of setting up AJAX capabilities in a SharePoint environment to support web parts I'm creating with C#. I am using Microsoft's walkthrough as a starting point just to get up and running, and I am running into what I believe is a strange error. The problem is occurring in CreateChildControls(): protected ...

CreateChildControls AFTER Postback

I'm creating my own CompositeControl: a collection of MyLineWebControl and a "add" button. When the user press the "add" button, a new MyLineWebControl is added. In CreateChildControls(), I run through my model (some object MyGridOfLines which has a collection of MyLine) and add one MyLineWebControl for each MyLine. In addButton.Click,...

RadGrid override CreateChildControls

I'm extending the tellerick RadGrid control to give it an optional CustomSearchControl. protected override void CreateChildControls() { this.Controls.Add(CustomSearchControl); base.CreateChildControls(); this.Controls.Add(CustomSearchControl); } It seems that base.CreateChildControls() must have a clear c...