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

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

    I also want to add that I've seen user controls work the way that you'd expect them to just by setting the Control.ID property at run time. If you do not set the ID, items may get built in a different order and work oddly.

提交回复
热议问题