Hi.. I've a problem about ViewState.

  • Thread starter Thread starter zimzion
  • Start date Start date
Z

zimzion

Hi..

My problem is that the ViewState of UserControl is not
consisted when the UserControl is dynamically loaded at
PreRender Event.

That is, A UserControl is dynamically loaded at PreRender
Event of a WebForm. Then, a server control in the
UserControl fires post-back event and at this time the
UserControl is dynamically loaded at Load Event of the
Page. But the ViewState of the loaded UserControl is
completely clear.

Is there any way to consist the ViewState even though
UserControl is loaded at PreRender Event?
 
ZimZion:

If I read your Q correctly: any changes to ViewState made after PreRender
are not saved. You will have to override the LoadViewState event procedure
to gain access to the ViewState field after the postback.

HTH
 
Back
Top