Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > Cannot Remove WebPart View modes: 
User avatar
Member
Member
robert-tailor.co - 8/20/2012 8:15:05 PM
   
Cannot Remove WebPart
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?

User avatar
Kentico Consulting
Kentico Consulting
kentico_borisp - 8/21/2012 5:49:56 AM
   
RE:Cannot Remove WebPart
Hello,

Could you please let me know which version of Kentico are you using including hotfix number? Have you customized the web part in any way?

Best regards,
Boris Pocatko