When “must” I use asp.net CreateChildControls()?

前端 未结 4 1592
清酒与你
清酒与你 2020-12-19 16:49

While it seems that the \"right\" way to make a server control is to construct all child controls inside CreateChildControls call. But since it\'s difficult to know when it

4条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-19 17:03

    Read Control Execution Lifecycle

    The CreateChildControls method is called whenever the ASP.NET page framework needs to create the controls tree and this method call is not limited to a specific phase in a control's lifecycle. For example, CreateChildControls can be invoked when loading a page, during data binding, or during rendering.

提交回复
热议问题