Should I ignore the occasional Invalid viewstate error?

后端 未结 10 645
小鲜肉
小鲜肉 2020-12-07 08:42

Every now and then (once every day or so) we\'re seeing the following types of errors in our logs for an ASP.NET 3.5 application

  • Invalid viewstate
  • Inv
10条回答
  •  眼角桃花
    2020-12-07 09:25

    There's not much you can do about the former - I trap such exceptions and bounce the user to an error page with a message along the lines of "The page you were on has expired. This normally happens when you try to revisit a page where you had already entered data."

    I see the latter most on a fairly large pages that use UpdatePanels. I think it's when the user posts back (or possibly calls back) before the page has finished loading, so not all the javascript that gets tagged on the end of the page has run yet.

    Again, there's not much you can do about them except show a suitably friendly message on your error page.

提交回复
热议问题