Problem with dynamic controls in .NET

前端 未结 9 1129
迷失自我
迷失自我 2020-12-13 07:50

Problem with dynamic controls

Hello all,

I\'m wanting to create some dynamic controls, and have them persist their viewstate across page loads. Easy enough,

9条回答
  •  既然无缘
    2020-12-13 08:12

    I believe that once you have added the dynamic controls to the page in PageLoad, the ViewState is bound to the controls and the "ViewState still needs to be bound" flag (in concept, not an actual flag) is cleared. Then, when you recreate the controls, the existing ViewState is no longer bound.

    I faced something similar last year, only in my case I did not want the ViewState to rebind. My issue is that I was not recreating the previous controls, which is why I think that the pseudo-flag notion above applies.

提交回复
热议问题