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.
精彩评论