ASP.Net: User controls added to placeholder dynamically cannot retrieve values

前端 未结 8 1746
攒了一身酷
攒了一身酷 2021-02-09 02:53

I am adding some user controls dynamically to a PlaceHolder server control. My user control consists of some labels and some textbox controls.

When I submit the form

8条回答
  •  甜味超标
    2021-02-09 03:43

    You have to create your controls in the Page_PreInit event handler. The ASP.NET server control model is tricky; you have to fully understand the page lifecycle to do it right.

提交回复
热议问题