I am developing a custom control that needs it’s viewstate to be loaded on init. Can I antecipate the view state loading at any time?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.