Viewstate错误

时间:2009-07-26 22:47:05

标签: asp.net viewstate

我在实际网站上收到了一个视图状态错误:感谢任何建议

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) 

3 个答案:

答案 0 :(得分:0)

Viewstate错误的问题在于它们没有告诉您太多并且很难进行故障排除。这件事刚刚开始吗?这有什么事情发生在现场或是可以复制的东西吗?

这是一个开始的地方 http://support.microsoft.com/kb/555353

和另一个 http://weblogs.asp.net/owscott/archive/2004/11/02/What-causes-ViewState-Errors.aspx

答案 1 :(得分:0)

问题中的更多信息会很方便。对于每个用户来说,在做某件事时,每次都会发生这种情况吗?或者 - 它只是错误日志中的随机消息,很少发生?

如果是后者,那么看起来有人要么在它被发回给你之前尝试使用ViewState(可能是因为尝试对你的服务器做了一些令人讨厌的事情),或者出于某种原因,ViewState正在为您的访问者损坏。可能是从奇怪的浏览器问题到客户端PC上狡猾的软件吗?!

答案 2 :(得分:0)

错误消息包括:

  

Base-64字符数组的长度无效。

您可以检查您的网页生成的ViewState的长度吗?已知一些浏览器会修剪ViewState,如果它太长了......