G
Guest
Hi,
When I’m trying to switch from Presentation Mode to Author Mode, at that
point a control is loaded in a custom place holder and I’m getting this
error:
SYSTEM_EXCEPTION: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.:
System.Web.HttpException: 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. at System.Web.UI.Control.LoadViewStateRecursive(Object
savedState) at System.Web.UI.Control.LoadViewStateRecursive(Object
savedState) at System.Web.UI.Control.AddedControl(Control control, Int32
index) at System.Web.UI.ControlCollection.Add(Control child) at
Com.MphasiS.JetAirways.TravelPortal.Web.CustomPlaceholders.JetTPPHFAQ.CreatePresentationChildControls(BaseModeContainer
presentationContainer) in
c:\inetpub\wwwroot\jettravelportal\customplaceholders\jettpphfaq.cs:line 79
Code for Authoring and Presentation Mode is:
protected override void CreateAuthoringChildControls(BaseModeContainer
authoringContainer)
{
try
{
authorisationGrid
=(UCFAQ)Page.LoadControl("../UserControls/UCFAQ.ascx");
authoringContainer.Controls.Add(authorisationGrid );
}
catch(System.Exception sysEx)
{
//catch code
}
}
protected override void CreatePresentationChildControls(BaseModeContainer
presentationContainer)
{
try
{
postingNav =(UCFAQPostingNav)
Page.LoadControl("../UserControls/UCFAQPostingNav.ascx");
presentationContainer.Controls.Add(postingNav);
presentationGrid =(UCFAQsSummary)
Page.LoadControl("../UserControls/UCFAQsSummary.ascx");
presentationContainer.Controls.Add(presentationGrid);
}
catch(System.Exception sysEx)
{
//catch code
}
}
Actually, in my module, in both the modes, i.e. Authoring and Presentation,
the way in which we are presenting data is different. So when I’m trying to
switch from Presentation to Authoring mode or vise-versa, it is throwing an
exception.
How can I solve it, please advice.
Thanks,
Pooja.
When I’m trying to switch from Presentation Mode to Author Mode, at that
point a control is loaded in a custom place holder and I’m getting this
error:
SYSTEM_EXCEPTION: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.:
System.Web.HttpException: 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. at System.Web.UI.Control.LoadViewStateRecursive(Object
savedState) at System.Web.UI.Control.LoadViewStateRecursive(Object
savedState) at System.Web.UI.Control.AddedControl(Control control, Int32
index) at System.Web.UI.ControlCollection.Add(Control child) at
Com.MphasiS.JetAirways.TravelPortal.Web.CustomPlaceholders.JetTPPHFAQ.CreatePresentationChildControls(BaseModeContainer
presentationContainer) in
c:\inetpub\wwwroot\jettravelportal\customplaceholders\jettpphfaq.cs:line 79
Code for Authoring and Presentation Mode is:
protected override void CreateAuthoringChildControls(BaseModeContainer
authoringContainer)
{
try
{
authorisationGrid
=(UCFAQ)Page.LoadControl("../UserControls/UCFAQ.ascx");
authoringContainer.Controls.Add(authorisationGrid );
}
catch(System.Exception sysEx)
{
//catch code
}
}
protected override void CreatePresentationChildControls(BaseModeContainer
presentationContainer)
{
try
{
postingNav =(UCFAQPostingNav)
Page.LoadControl("../UserControls/UCFAQPostingNav.ascx");
presentationContainer.Controls.Add(postingNav);
presentationGrid =(UCFAQsSummary)
Page.LoadControl("../UserControls/UCFAQsSummary.ascx");
presentationContainer.Controls.Add(presentationGrid);
}
catch(System.Exception sysEx)
{
//catch code
}
}
Actually, in my module, in both the modes, i.e. Authoring and Presentation,
the way in which we are presenting data is different. So when I’m trying to
switch from Presentation to Authoring mode or vise-versa, it is throwing an
exception.
How can I solve it, please advice.
Thanks,
Pooja.