Wrox Programmer Forums
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old January 5th, 2006, 08:18 AM
Registered User
Join Date: Dec 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Error Problem

Can any one help me in this problem?

I have created one control. now that control i am calling in other page but while calling that control I am getting this error. Plz help me.

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.

Old January 5th, 2006, 09:56 AM
planoie's Avatar
Friend of Wrox
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts

This sounds like you are adding a control to a page dynamically but not adding it again when the postback occurs. As the error message suggests, you need to reconstruct the page in such a way that the control structure matches when the page posts back.

I've seen this problem when someone attempts to have a button click handler add a control. When the page posts back, that button click handler doesn't execute and thus the control doesn't get added back into the control hierarchy. This results in a out-of-sync control tree.

Can you post just the code that relates to the control that is causing the problem?


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error Reporting Problem Alexander L Gallegos BOOK: Beginning ASP 3.0 0 September 18th, 2008 08:51 PM
IConvertible error problem geek.net ADO.NET 1 February 14th, 2006 06:44 PM
Error Message Problem kuku SQL Server 2000 1 September 6th, 2005 04:30 PM
Error Number Problem momowu0701 VB.NET 2002/2003 Basics 2 March 4th, 2004 12:03 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.