asp.net - Why clear controls in CreateChildControls -


All examples of ASP.NET composite control always illustrate child controls such as the first action within CreateChildControls. Why is it like this? As I have understood, this method is always called through the Ancestor Child Control, which indicates the flag to indicate that it has already been called and thus the CreateChildControls are not called again. .

Is CreateChildControls called by other aspects of the infrastructure? What is the situation in this situation?

There is nothing to prevent you from creating control and adding them to control during OnInit of Control The archive is called the CreateChildControls when the already existing control is present. This may look strange, but what if you are expanding a control, do you know that when your control base methods (Base Constructor, or Base .com), then this base What is the control?

Basically, calling control. Clear () is the best practice before.


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

php - jQuery AJAX Post not working -