Wednesday, March 28, 2012

Viewstate verification failed - HELP my website is falling apart. Again :-(

I have a timer component that refreshes my page every minute but after a while it fails with the error "Viewstate verification failed". I left the page refreshing last night and it showed it stopped after 3 hours. The contents of the page haven't changed so I'm wondering if it is a timing issue with another component on my master page that has a javascript timer to which refreshes itself using callbacks.

The full error from my Event Viewer is:

Event Type: Information
Event Source: ASP.NET 2.0.50727.0
Event Category: Web Event
Event ID: 1316
Date: 15/02/2007
Time: 03:31:22
User: N/A
Computer: MAT
Description:
Event code: 4009
Event message: Viewstate verification failed. Reason: Viewstate was invalid.
Event time: 2/15/2007 3:31:22 a.m.
Event time (UTC): 2/14/2007 2:31:22 p.m.
Event ID: b68b7d7fa4d446b3adba40708b352b32
Event sequence: 341
Event occurrence: 1
Event detail code: 50204

Application information:
Application domain: /LM/W3SVC/1/Root/flo-1-128159266743963684
Trust level: Full
Application Virtual Path: /flo
Application Path: c:\inetpub\wwwroot\flo\
Machine name: MAT

Process information:
Process ID: 2308
Process name: aspnet_wp.exe
Account name: MAT\ASPNET

Request information:
Request URL:http://localhost/job_status.aspx
Request path: /job_status.aspx
User host address: 127.0.0.1
User: matthew
Is authenticated: True
Authentication Type: Forms
Thread account name: MAT\ASPNET

ViewStateException information:
Exception message: Invalid viewstate.
Client IP: 127.0.0.1
Port: 1349
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; InfoPath.1; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30)
PersistedState: /wEWBQK9m9+mCQL20L6+CQLh8tHdBgLd/pFuArD90/EPqAe+PBf42BwApxmU14Oldo6DzQU=
Referer:http://localhost/job_status.aspx
Path: /job_status.aspx

Custom event details:

For more information, see Help and Support Center athttp://go.microsoft.com/fwlink/events.asp.

Any help would be appreciated.

Hi Matthew,

I remember some time ago to find a similar problem. It had to do with the fact that viewstate is saved in a hidden field at the end of the page, and continuous AJAX refreshes queued successive requests before they were finished, at the point where the request still had to reach the "end" of the page, where the ViewState resides. As you can see, the ViewState validator couldn't do it's work and, therefore, it threw an exception like the one you are having.

If you search the forum you may find that thread, as I haven't started it I have no easy way to point you to the link. I think I remember there was a workaround as well.

Sorry not to be more helpful, but maybe at least I gave a direction to start looking at.

Regards,

Juan


Thanks for the info. I have set up two almost duplicate copies of the site, one with buffering and one without to see if that is causing invalid data. If that doesn't work I'll look for the thread you mentioned.


Have you figured this out yet? I'm seeing this intermittently and am not sure where it's coming from.

Thanks!


I have managed to resolve this problem by not having multiple types of callback components, ie AJAX and custom made callback scripts.

What I did in the end was to setup a timer on the masterpage. On the content pages if I want update panels to update I add a trigger to the update panel that is pointing to the timer on the masterpage. Therefore evry minute the timer on the masterpage refreshes all updatepanels that are connected to it.

If you need more info let me know and i'll sort some code out for you.

No comments:

Post a Comment