Viewstate and controls in ASP.NET

前端 未结 4 745
轮回少年
轮回少年 2021-02-09 01:56

I posted a question a couple of days ago about viewstate and after running some tests I have come to some conclusions/results. Based on these results I have a few questions as t

4条回答
  •  耶瑟儿~
    2021-02-09 02:22

    Did you try to use LoadComplete event?

    Use this event for tasks that require that all other controls on the page be loaded.

    This is fired after PageLoad and all events (ButtonClick, etc.), so your UserControls are are loaded in ButtonClick events, and in LoadComplete their ViewState is already initialized.

提交回复
热议问题