LoadViewState not fired on my user control

后端 未结 2 1383
刺人心
刺人心 2021-01-21 05:20

I have a user control nested in a repeater. Inside my user control I have another repeater and in that I have a panel.

I am trying to override the LoadViewState event

2条回答
  •  不要未来只要你来
    2021-01-21 05:29

    LoadViewState isn't the appropriate place for adding child controls. For dynamically adding controls within a user control, you'll want to look at the CreateChildControls method.

    It's not firing a LoadViewState event because you need to save at least one value in the ViewState to have the event fire.

提交回复
热议问题