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

前端 未结 8 1884
攒了一身酷
攒了一身酷 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:37

    I believe you'll need to add the UserControl to the PlaceHolder during the Init phase of the page life cycle, in order to get the ViewState to be filled in by the Load phase to read those values. Is this the order in which you're loading those?

提交回复
热议问题