How to persist a dynamic control (c#)

前端 未结 4 1155
北荒
北荒 2021-01-16 06:15

As per the title, I have created a custom control.

On a certain button click event, this control is instantiated, then added to the page.

It is a dynamic con

4条回答
  •  南方客
    南方客 (楼主)
    2021-01-16 07:00

    I believe all you need to do is recreate it with the same ID during pre init and the asp.net engine will populate it from the view state.

    This is off the top of my head, so I might have the details off a bit.

提交回复
热议问题