YAFLogo

Stief
  • Stief
  • 59% (Neutral)
  • YAF Camper Topic Starter
13 years ago
Hi,

I'm using a custom membership and role provider with the default profile provider from YAF. I'm using the latest compiled source code version. When I go into the admin area to Settings - Users and I search for users I recieve 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:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

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) +327

System.Web.UI.Control.AddedControl(Control control, Int32 index) +9033934

System.Web.UI.ControlCollection.Add(Control child) +79

YAF.Controls.MessageBox.CreateChildControls() in C:\Users\RobbyC\Desktop\yafsrc\YAF.Controls\MessageBox.cs:186

System.Web.UI.Control.EnsureChildControls() +102

System.Web.UI.Control.PreRenderRecursiveInternal() +42

System.Web.UI.Control.PreRenderRecursiveInternal() +175

System.Web.UI.Control.PreRenderRecursiveInternal() +175

System.Web.UI.Control.PreRenderRecursiveInternal() +175

System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2496

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.237

Sponsor
Stief
  • Stief
  • 59% (Neutral)
  • YAF Camper Topic Starter
13 years ago
ok, found the problem. I made some changes to the default yaf files (jquery and extra html code) which caused this error.
funkypiffo
12 years ago
How did you solve it?

I also added some html code (no aspx) and hit the same problem.

Stief
  • Stief
  • 59% (Neutral)
  • YAF Camper Topic Starter
12 years ago
If you want to add or change html elements you should alter the source code. .Net has some internal checks to see if the html elements change when the form is posted due to security.