Thanks for Eliyahu's input,
Hi Mark,
As Eliyahu has mentioned, the restore of controlstate/viewstate does occur
after the control's "CreatechildControls" be called. Actually, except the
first request(before postback), in each postback request, the control will
first reconstruct its control Tree by calling "CreateChildControls" method.
Then, it perform Init on the control hierarchy and restore
viewstate/control state from the persistent storage(the <input hidden >
element in page). And In Load event, the ViewState should has been
available there. So generally, in "CreateChildControls" method, we should
only put code that simply construct the control tree of webcontrol, and the
code logic there should not rely on those resource that are not available
at that time(such as ViewState).
I think you may have some code logic about the control structure(sub
control) depend on the viewstate. Would you provide some further
information on this? We can try looking for some other approaches to
overcome the issue.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.