Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

ASP.NET Viewstate exception error.

Posted on 2006-05-24
3
Medium Priority
?
1,297 Views
Last Modified: 2011-09-20
Hello,

I am getting this error and have no idea how to tackle it or how to trace it down any help would be valuble. It happens on many pages on my site. I think it may be linked to the load event on an ascx file but I am not sure. I use Session variables and cookies to store user information like refering url, and a few of parameters that are passed to the page.
Any other info I can provide please let me know.


<-------------------------------------------------------------------------------------->
Last Exception

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


Source: System.Web


Trace Stack:    at System.Web.UI.ViewStateException.ThrowError(Exception inner, String persistedState, String errorPageMessage, Boolean macValidationError)
   at System.Web.UI.HiddenFieldPageStatePersister.Load()
   at System.Web.UI.Page.LoadPageStateFromPersistenceMedium()
   at System.Web.UI.Page.LoadAllState()
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   at System.Web.UI.Page.ProcessRequest()
   at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)
   at System.Web.UI.Page.ProcessRequest(HttpContext context)
   at ASP.services_development_automation_aspx.ProcessRequest(HttpContext context)
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)


Base Exception

Error Message: Invalid character in a Base-64 string.


Source: mscorlib


Trace Stack:    at System.Convert.FromBase64String(String s)
   at System.Web.UI.ObjectStateFormatter.Deserialize(String inputString)
   at System.Web.UI.ObjectStateFormatter.System.Web.UI.IStateFormatter.Deserialize(String serializedState)
   at System.Web.UI.Util.DeserializeWithAssert(IStateFormatter formatter, String serializedState)
   at System.Web.UI.HiddenFieldPageStatePersister.Load()
<-------------------------------------------------------------------------------------->

I also get this message but much less often.


<-------------------------------------------------------------------------------------->
Last Exception

Error Message: The client disconnected.


Source: System.Web


Trace Stack:    at System.Web.UI.ViewStateException.ThrowError(Exception inner, String persistedState, String errorPageMessage, Boolean macValidationError)
   at System.Web.UI.HiddenFieldPageStatePersister.Load()
   at System.Web.UI.Page.LoadPageStateFromPersistenceMedium()
   at System.Web.UI.Page.LoadAllState()
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   at System.Web.UI.Page.ProcessRequest()
   at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)
   at System.Web.UI.Page.ProcessRequest(HttpContext context)
   at ASP.services_data_services_append_aspx.ProcessRequest(HttpContext context)
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)


Base Exception

Error Message: Invalid character in a Base-64 string.


Source: mscorlib


Trace Stack:    at System.Convert.FromBase64String(String s)
   at System.Web.UI.ObjectStateFormatter.Deserialize(String inputString)
   at System.Web.UI.ObjectStateFormatter.System.Web.UI.IStateFormatter.Deserialize(String serializedState)
   at System.Web.UI.Util.DeserializeWithAssert(IStateFormatter formatter, String serializedState)
   at System.Web.UI.HiddenFieldPageStatePersister.Load()

<-------------------------------------------------------------------------------------->

0
Comment
Question by:VictorJuri
1 Comment
 
LVL 2

Accepted Solution

by:
VeryNiceMan earned 2000 total points
ID: 16766198
hi;

you didn't tell us which Asp.Net you are using; my guess that you have been upgrading to new version recently. anyway; my advice to take this ONE step at a time as fixing one problem could fix the others:

1) Check that you don't have FrameWork version conflict and your machine is virus free; try to run the whole thing on clean machine. if it works then both problems (the viewstate) and the (base64) errors will disapear.

2) Search for any server control that is outside the Form tag!!

3) Pick the worst page (the one that causes the error to show more often); re-create the page and copy/past the code to the fresh one

4) Try the following with the worst page:
<pages enableEventValidation="false" enableViewStateMac="false" viewStateEncryptionMode ="Never" >
<pages enableEventValidation="false" enableViewStateMac="false">

5) Try to reduce the load on ViewState by eliminating item-by-item and check to see if a particular item is causing the problems (downsize the viewstate size)

6) Shut-down any firewalls and test

7) Try the bad step; read http://support.microsoft.com/?id=829743 and follow instructions

8) if this is a LIVE web application then the website might be under attack!! (different actions are required)

9) if all failed send me the following and i'll give it a try:
your FrameWork Version
Asp.Net Version
and sample code the causes such errors


hope this helps;
best regards;
 

0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What do responsible coders do? They don't take detrimental shortcuts. They do take reasonable security precautions, create important automation, implement sufficient logging, fix things they break, and care about users.
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Starting up a Project

578 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question