G
Guest
Hi!
I have an application that looks something like this:
************************************************************
Order.aspx
|--Thanks.ascx
|--Step.ascx
|--MultiView
|--(View1)Whois.ascx (contains EventHandler's)
|--(View2)Webbpaket.ascx
|--(View3)ContactInfo1.ascx
|--(View3)Login.ascx (contains EventHandler's)
|--etc...
|--Start.ascx
************************************************************
The "user controls" is shown/hided (visible=true/false) in the MultiView
depending on the querystring and some other info, ex: if the querystring is
"?Action=1" all UC's will be used in the Multiview but if the querystring is
"?Action=2" then all except "View2" will be used in the Multiview and it's
here where my problems start.
When "View2" is hidden my UC's containing an eventhandler will cause the
error:
**Error******************************************************
Failed to load viewstate. The control tree into which viewstate is being
loaded must match the control tree that was used to save viewstate during the
previous request. For example, when adding controls dynamically, the controls
added during a post-back must match the type and position of the controls
added during the initial request.
************************************************************
I assume that it is the viewstate in Order.aspx that complains and not in
one of my UC's, but how do I solve this? Setting "EnableViewstate=false" is
out of the question!
I have an application that looks something like this:
************************************************************
Order.aspx
|--Thanks.ascx
|--Step.ascx
|--MultiView
|--(View1)Whois.ascx (contains EventHandler's)
|--(View2)Webbpaket.ascx
|--(View3)ContactInfo1.ascx
|--(View3)Login.ascx (contains EventHandler's)
|--etc...
|--Start.ascx
************************************************************
The "user controls" is shown/hided (visible=true/false) in the MultiView
depending on the querystring and some other info, ex: if the querystring is
"?Action=1" all UC's will be used in the Multiview but if the querystring is
"?Action=2" then all except "View2" will be used in the Multiview and it's
here where my problems start.
When "View2" is hidden my UC's containing an eventhandler will cause the
error:
**Error******************************************************
Failed to load viewstate. The control tree into which viewstate is being
loaded must match the control tree that was used to save viewstate during the
previous request. For example, when adding controls dynamically, the controls
added during a post-back must match the type and position of the controls
added during the initial request.
************************************************************
I assume that it is the viewstate in Order.aspx that complains and not in
one of my UC's, but how do I solve this? Setting "EnableViewstate=false" is
out of the question!