开发者

How do I force view-state to be loaded in an earlier stage of the page life-cycle?

I am developing a custom control that needs it's viewstate to be loaded on init. Can I antecipate the 开发者_StackOverflow社区view state loading at any time?


No. The purpose of ViewState loading when it does is because it FIRST loads your controls default values (i.e. what you have in your aspx files) and THEN overwrites it with your ViewState (i.e. previously submitted values) and THEN overwrites that with your post data. You can't mess with that order or you break the entire page lifecycle within ASP.NET. You MIGHT be able to take a look at the Request and/or Response objects and pick things out of there manually, but you can't have the framework do it for you.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜