Hi,
I added a SearchResults web part to a page template using the Portal design mode. I now need to delete this web part from the page.
When I click 'Remove' in the Design tab, I get the following error:
Server Error in '/' Application.
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.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: 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.
Source Error:
Line 1119: plcBasicRepeater.Controls.Clear();
Line 1120: repSearchResults.ID = "repSearchResults";
Line 1121: plcBasicRepeater.Controls.Add(repSearchResults);
Line 1122: }
Line 1123: }
Source File: c:\Work\NET\Austral\www.australbricks.com\CMSModules\SmartSearch\Controls\SearchResults.ascx.cs Line: 1121
Stack Trace:
[HttpException (0x80004005): 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.UI.Control.LoadViewStateRecursive(Object savedState) +11425249
System.Web.UI.Control.AddedControl(Control control, Int32 index) +11422559
CMSModules_SmartSearch_Controls_SearchResults.Page_Load(Object sender, EventArgs e) in c:\Work\NET\Austral\www.australbricks.com\CMSModules\SmartSearch\Controls\SearchResults.ascx.cs:1121
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +25
CMS.ExtendedControls.AbstractUserControl.OnLoad(EventArgs e) +130
System.Web.UI.Control.LoadRecursive() +71
System.Web.UI.Control.LoadRecursive() +190
System.Web.UI.Control.LoadRecursive() +190
System.Web.UI.Control.LoadRecursive() +190
System.Web.UI.Control.LoadRecursive() +190
System.Web.UI.Control.LoadRecursive() +190
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3064
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272
What's gone wrong here, and how can I remove the web part?