views:

218

answers:

3

Hi! I am getting a viewstate error on the live site: Thanks on any advice

Inner Exception: System.Web.UI.ViewStateException: Invalid viewstate. Client IP: 111.34.19.201 Port: 54016 User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; GTB6; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30618) ViewState: /wEPDwUKMTIyOTg3NTc3MA9kFgJmD2QWAgIBD2QWAgIBD2QWAgIHD2QWAmYPZBYCAgEPFCsAAg8WBB4LXyFEYXRhQm91bmRnHgtfIUl0ZW1Db3VudAJkZGQWAmYPZBYGAgEPFCsAAmRkFgJmD2QWAgIDDxAPFgIfAGdkDxYKZgIBAgICAwIEAgUCBgIHAggCCRYKEAUBMQUBMWcQBQEyBQEyZxAFATMFATNnEAUBNAUBNGcQBQE1BQE1ZxAFATYFATZnEAUBNwUBN2cQBQE4BQE4ZxAFATkFATlnEAUCMTAFAjEwZxYBAgJkAgMPZBYUZg9kFgJmD2QWAgIBD2QWAmYPZBYCZg9kFhJmDxUBDE1MUyM6IDc5MjQxN2QCAQ8PFgIeC05hdmlnYXRlVXJsBSBEZXRhaWxzLmFzcHg/aWQ9NzkyNDE3JnQ9Tk9MQU1MU2QWAmYPFgIeA3NyYwUcfi9waWN0dXJlcy83OTI0MTdfMTAxXzEyLmpwZ2QCAw8PFgIfAgUgRGV0YWlscy5hc3B4P2lkPTc5MjQxNyZ0PU5PTEFNTFNkFggCAQ8PFgIeBFRleHQFEzc2MCBNQUdBWklORSBTVCAyMjBkZAIDDw8WAh8EBQtOZXcgT3JsZWFuc2RkAgUPDxYCHwQFAkxBZGQCBw8PFgIfBAUFNzAxMzBkZAIFDw8WAh8EBQQxOTUwZGQCCQ8PFgIfBAUBMmRkAg8PDxYCHwQFATJkZAIVDw8WAh8EBQsxMDY4IHNxLmZ0LmRkAhYPFQGCATIgU1RPUlkgQ09ORE8gV0lUSCBUV08gQkVEUywyLjUgQkFU... ---> System.FormatException: Invalid length for a Base-64 char array. 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() --- End of inner exception stack trace ---

Target Site: Void ThrowError(System.Exception, System.String, System.String, Boolean)

Stack trace: at System.Web.UI.ViewStateException.ThrowError(Exception inner, String persistedState, String errorPageMessage, Boolean macValidationError) at System.Web.UI.ViewStateException.ThrowViewStateError(Exception inner, String persistedState) 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.listing_aspx.ProcessRequest(HttpContext context) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
A: 

The problem with Viewstate errors is that they don't tell you much and are hard to troubleshoot. Is this something that just started? Does this ony happen in the live site or is it something that can be reproduced?

Here's a place to start http://support.microsoft.com/kb/555353

and another http://weblogs.asp.net/owscott/archive/2004/11/02/What-causes-ViewState-Errors.aspx

David Stratton
this only happens in the live site..looks like they are using firefox or something..been testing the app in the development environment using internet explorer..and never seen this error before. I dont know how to repoduce the error to troubleshoot it.
You may not be able to find the exact cause. As Chris Roberts posted, this may be intentional tampering with the Viewstate. On the other hand, it may be one of the items mentioned in the articles I linked to, or it could be just buggy behavior from a browser or a particular customer's PC configuration. Our site works for almost everyone except this same error gets thrown for 5 customers that all have an operating system/browser in common. (not the same as shown in your original log post)
David Stratton
(continued)I mention the browser issue for the same reason Stobor does because it probably has bearing on what's happening in your situation.
David Stratton
A: 

Hi,

A little more information in the question would be handy. Does this happen every time, for every user, when doing a particular thing? Or - is it just a random message in your error log which happens very rarely?

If it's the latter, then it looks like someone is either trying to play around with the ViewState before it gets posted back to you (possibly in a failed attempt to do something nasty to your server), or for some reason the ViewState is getting corrupted for one of your visitors. Could be anything from a strange browser problem to dodgy software on the client PC?!

Chris Roberts
A: 

The error message includes:

Invalid length for a Base-64 char array.

Can you check the length of the ViewState that your page is generating? Some browsers are known to trim the ViewState, if it gets too long...

Stobor