.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

The state information is invalid and might be corrupt? Check this.

Posted By:      Posted Date: October 12, 2010    Points: 0   Category :ASP.Net

I finally figured out why but don't know how to fix this.  I am storing a multi-dimensional array into a viewstate variable.  But when the page postsback, (BEFORE PAGE_LOAD) , i get the error in IE6 that the state information is invalid and might be corrupt.  Nothing else works, the PAGE_LOAD won't fire which I suspect it is stuck in pre_load during viewstate loading.

Here's the thing, the problem does not occur when storing a single-dimension array to viewstate. the problem ONLY occurs to storing a multi-dimensional array to viewstate.  The next time the page attempts to recycle, and then goes to load viewstate, it fails.

Here's the code.

//this function causes the viewstate error after subsequent postback.

bool[,] regsettings020 = new bool[5, 3];
ViewState["regsettings3"] = regsettings020; 
regsettings020 = (bool[,])ViewState["regsettings3"]; // just reading back for fun, it works

// this function does not cause the view state error because it only stored a single dimension array

bool[] regsettings020 = new bool[5];
ViewState["regsettings3"] = regsettings020; 
regsettings020 = (bool[])ViewState["regsettings3"]; // just reading back for fun, it works

View Complete Post

More Related Resource Links

The state information is invalid for this page and might be corrupted.

Dear All,     I got the following error today. But yesterday this application is running fine.     Even today i try to move this project to another server. The same symptom I got.     Does anyone know what's happened for this case?     Thanks, Best Regards, Benny Ng       Server Error in '/LGOldServices' Application.-------------------------------------------------------------------------------- The state information is invalid for this page and might be corrupted.Description: An unhandled exception occurred during the execution of thecurrent web request. Please review the stack trace for more informationabout the error and where it originated in the code. Exception Details: System.Web.HttpException: The state information isinvalid for this page and might be corrupted. Source Error: [No relevant source lines] Source File: c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NETFiles\lgoldservices\10b99f4d\fe7b353e\App_Web_jlz_zk70.4.cs    Line: 0 Stack Trace: [FormatException: Invalid character in a Base-64 string.]   System.Convert.FromBase64String(String s) +0   System.Web.UI.ObjectStateFormatter.Deserialize(String inputString) +67   System.Web.UI.ObjectStateFormatter.System.Web.UI.IStateFormatter.Deserialize(StringserializedState) +4   System.Web.UI.Util.DeserializeWithAssert(IStateFormatter formatter,String serializedState) +37   System.Web.UI.HiddenFieldPageState

The state information is invalid for this page and might be corrupted.


I am getting the "The state information is invalid for this page and might be corrupted." error while creating tabs using jquery. I am loading pages to the dynamically created div using jquery and when i click any of the buttons in the page i get this error. The created tabs are working fine.  Only thing is if i click any buttons that cause postback resulting in the above error. Help me please regarding this.

The state information is invalid for this page and might be corrupted.



I have read the full 6 pages (90 posts) of the thread http://forums.asp.net/7/1173230/ShowThread.aspx and tried just about every single suggestion. nothing has fixed this error.
Sorry for duplicate posting this, I posted this question in that forum thread as well but i have since realized that thread has the "answered" icon so i doubt i will get much help from posting in that thread...

My c# asp.net 2.0 website has not been upgraded from a 1.1 or 1.0 project. I built it from scratch, using 2.0 the whole time. (It would seem most people have this error due to an "upgrading from 1.1" issue, which isn't the case for me)

The error I am getting is:

The state information is invalid for this page and might be corrupted.

and my current web.config file looks like this:






validateRequest="false" >


The page(s) that produce this error are all on Firefox. I simultaneously run IE on the same pages to test things at the same time and find that IE has no conflicts whatsoever, these errors are occuring in Firef

Invalid length for a Base-64 char array - how do I check the length?????


Invalid length for a Base-64 char array

I am encrypting and decrypting my querystring. I need a way of checking the querystrings length before I decrypt it. When I mess with the querystring, shorten it for example, my decryption method fails. Can somebody help me with the if statement please to check the length of the urlDecode string??????

public static string Decrypt(string inputText)      {          if (!String.IsNullOrEmpty(inputText))

Three State Workflow Emails have invalid links


I've attached a standard three-state workflow to a document library.  When the emails arrive in users' inboxes, the links back to the document don't work if the document file name includes spaces.  It appears the workflow is not encoding the spaces, correctly.  If the message is opened in Lotus Notes, the spaces are completely stripped out (e.g. "My File Name" is "MyFileName").  If the message is opened in Gmail, the spaces are replaced with + signs.  (e.g. "My File Name" becomes "My+File+Name"). 

I've searched the forums and elsewhere, and I can't find any resolution for this.  To the best of my knowledge, no other emails, either from workflows or alerts, have this problem. Any suggestions?  This is on MOSS 2007, by the way.



Unable to connect to database. Check database connection information and make sure the database ser



I am using MOSS2007. My MOSS site was working fine for last 1 month and today suddenly it started to show me below message

"Unable to connect to database.  Check database connection information and make sure the database server is running."


On my server, SahrePoint admin site is working. Other port site is also working. Only my MOSS site is showing me above message.  Can anyone helkp me to resolve this issue.

Token StartElement in state Epilog would result in an invalid XML document


i am getting the above error i knw the caus eof the error which is due t oopen /close xml elemnst in next loops

i amusing vs 2005

how do i rectify the error i am unbale to place the close elemnts correctly


Token StartElement in state Epilog would result in an invalid XML document.


An exception of type 'System.InvalidOperationException' occurred in System.Xml.dll but was not handled in user code

Additional information: Token StartElement in state Epilog would result in an invalid XML document.


 I GET THIS ERROR  dor one tag/elelemt

whts the meanig & how to hanfle it

View State Error when user tries to check in file


Recently we encounter issue with SharePoint 2007 that the user is unable to check in file. Whenever user try to check in file, it will show error page: 


Invalid viewstate.
Client IP: [IP Address]
Port: 58105
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; WOW64; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.0.30729; .NET CLR 3.5.30729)
ViewState: /wEWCQKOxPCTDQKPztqIBgKpn5bCCwLEiLTXBQKa/+iZBQKN/6CDBgKW/PDbDwLNrvW5AwLbqef0C9c8RUbYCyi0Rc58jgXqG3fOpsYC
Referer: [path]/Forms/AllItems.aspx
Path: /_layouts/Checkin.aspx


Any idea?? Thank you.

Using a CompareValidator to check input is a valid date

The CompareValidator can do more than just compare two controls. You can also compare it against several of the main .net data types such as Date, Integer, Double and Currency.

To do this you would set Operator="DataTypeCheck" and instead of setting the ControlToCompare or ValueToCompare attributes as you normally would you use the Type="Date" (or any of the data types I have listed above).

Truly Understanding View State

This article provides a detailed understanding of the ViewState.

Check All with JQuery and a Asp.Net GridView

Display a Grid on the screen with a checkbox in each row. At the bottom of the page have "Check All" button.

Typically if I need to do anything interesting I use a template column. So my GridView will look like the one below (most other columns removed for readability). The only interesting point to note is the CssClass="ApprovalCheckBox" in the CheckBox ItemTemplate.

How to get more information about the exceptions that can happen in SharePoint 2010 projects?

In case there is an exception anywhere in the SharePoint 2010 project (most common place an exception would happen is during deployment of your SharePoint project, custom deployment configuration or custom deployment steps), there's a registry key EnableDiagnostics available for you to use.

Design Patterns - Using the State Pattern in C#

What is the State Pattern?

The State Pattern is a behavioral pattern that can be used to alter the behavior of an object at run time. As the state of an object changes, the functionality of the object can change drastically. This change of behavior is hidden from the Client and the Client interfaces with a wrapper object known as the Context. The State Pattern is a dynamic version of the Strategy Pattern.

view state vs request parameters


If  the view state is the data entered into the form fields then they are supposed to be available in the request parameters or request body. Then why would we need view state for?


check box control


Hi ,

I have a three check box in my web form ,i need to choose only one check box, if i choose one check box

another 2 check box automatically unchecked

can i use jquery for check box

I thought this would be simple... Trying to create a login does an ajax check before submit


I have the standard .net login control that is working.  (Still learning .net after 15yrs of classic)

What I want to do is OnButtonClick run a javascript function (to do an ajax call to the db to check if login is valid or not) and if it returns true, then submit the form normally, else don't submit. The piece that I can't figure out, is how to correctly override the default click even to hit my JS routine and then submit the form properly afterwards.

Thanks ahead of time

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend