.NET Invalid viewstate Error

Posted on 2011-10-27
Last Modified: 2012-06-21
Hello Experts,

I keep getting this error which gets emailed to me from the Application_Error event:

System.Web.HttpException (0x80004005): The state information is invalid for this page and might be corrupted. ---> System.Web.UI.ViewStateException:
Invalid viewstate. Client IP: Port: 47545

Any idea what might be causing this? I can't see any problem in the code on the page that's causing it, and it only happens now and then.

Question by:tablaFreak
    LVL 33

    Accepted Solution

    It's posslble someone's accessing a page after their session has run out or, if the viewstate is stored in the URL, it may be the viewstate in the URL doens't match the controls on the page.  Either of these might be especially true for an old, saved link.

    Author Comment

    Thanks - do you know a good way of handling this error?
    LVL 33

    Expert Comment

    Not off the top of my head.  Do you know if this impacts what a visitor sees?

    I suppose you could try to trap it - I don't know how you'd do that - and tell the visitor they may be using an old link.  That said, if visitors aren't complaining, I wouldn't worry about it.

    Author Comment

    Yes, I don't actually know if the user sees any errors. I guess I'll just let it slide until there's some obvious negative consequence.

    Thanks for your help!

    Author Closing Comment

    thank you!

    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    Join & Write a Comment

    I have developed many web applications with asp & and to add and use a dropdownlist was always a very simple task, but with the new, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
    User art_snob ( encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…

    746 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

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now