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 March 16th, 2006, 06:08 AM
Authorized User
Join Date: Mar 2006
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default Strange Error !!!

Strange Error !!!

Help please.. i was testing my application today and i get this error message for the first time
and i don't know what i did wrong.. or what causing it.. i didn't get this error before
only today..the error is :

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.

please help me..it is driving me crazy.. because i tried to track it down using breakpoints but it didn't work



Happy Programming :)
Happy Programming :)
Old March 19th, 2006, 01:11 AM
Wrox Author
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons

This error occurs mostly when you are working with Dynamic controls, e.g. controls that you create at run time and add them to the Controls() array of your page (or form, or panel, etc). What this is saying is that you are either trying to remove controls from the control tree or add to them, and you cant do this as the viewstate doesnt match.

A good example of this is when you are working with datagrids where you edit the data inline (dg.edititemidex = e.item.itemindex) but you forget to call the dg.databind() method in the Method that calls the following code, if you try hitting the edit button, the error you are getting will be thrown.

If you are still having some problems post some source code and ill take a look at it for you.


"The one language all programmers understand is profanity."
Old May 21st, 2006, 01:34 AM
Registered User
Join Date: May 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts

Hi I get the same error and the problem arises when I try to save the values of the form. The form consist of a datagrid that has the Edit functionality.

Any ideas how to fix the issue.


Similar Threads
Thread Thread Starter Forum Replies Last Post
strange error Iguchi Visual Studio 2008 1 April 11th, 2008 06:21 AM
An Strange Error alirezaaali Classic ASP Professional 1 August 16th, 2007 10:03 AM
Strange ERROR (?) myself Classic ASP Basics 16 June 22nd, 2006 06:39 AM
strange error dynamic_iiita Beginning PHP 0 May 22nd, 2005 06:14 AM
Strange error eraser Classic ASP Basics 3 September 21st, 2004 07:55 AM

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