Update for viewstate issues


So a while ago I posted about how to fix the Validation of viewstate MAC failed error.  There is some really exciting news that is coming with Visual Studio 2008 Service Pack 1 and .NET Framework 3.5 Service Pack 1.  One of the improvements that they made for this Service Pack is to help alleviate this issue by doing something similar to the code change recommended on my blog.  So the form fields will be written out at the beginning of the form.

This means that we hopefully won’t get this error any longer from someone clicking on a page before it completely loads.  You can get the Service Pack here.

Please let us know if you run into this issue after installing this.

Comments (11)

  1. Vesta says:

    i had this error in vs 2005 what about that?

  2. tomchris says:

    Vesta,

    For VS 2005, you will have to use the workarounds documented on the previous post.

  3. Francois Ward says:

    Oh oh, thats interesting… I had missed that other post detailing the issue.

    I had that issue before (when I was explicitely encrypting viewstate, not because I was using a datakey), and had successfully figured out the issue.

    However, I didn’t quite understand WHY it happened (since ViewState is one of the first fields in the page). I wasn’t aware that encryption of viewstate added a field near the bottom, never notice…

    Now -that- explains it. Glad that its fixed in SP1.

  4. TheXenocide says:

    I’m glad you commented on this; I didn’t know you had posted on this before but the information could be very useful to us at work. Thanks!

  5. Mike says:

    This update has also effected the rendering of said tags in projects compiled for the 2.0 framework. I’m quite surprised to see the update effect NET 2.0, we now have a little issue to figure out.

    Our developers use VS 2008 targeting NET 2 framework but production has not yet ‘approved’ nor do we have a need for NET 3.5. What was done to 2.0? How do we get this fix to production?

  6. Mike says:

    After some investigation it appears that the 3.5 SP1 includes NET 2.0 SP2. I can find no info on a standalone NET 2.0 SP2 install or how you might apply only the 2.0 SP2 to a non 3.5 system.

  7. If you work with web sites in a complex/multi server environment you might be familiar with this error

  8. Paul says:

    I’m having this exact issue on a 3.5 sp1 site when there’s only 1 label  on the form (in an updatepanel) The updates itself every 5 secs with the current time. The error starts occuring after approx. 2:50 minutes. I’ll follow up with more info…

  9. vijaykumar_gupta says:

    I have same problem in .NET farme work 3.5 with service pack 1 while updating the page ‘s control value with postback.

    When erver i am trying to update grid through the update link i am getting this message……..

    "Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster."

    While i have update pane on the page and trying to update the grid without postback.

    Also i have implemented URL Rewring in my web application.

    Please  help me.

    Thanks

  10. Shreyash says:

    Hi,

    I'm getting a similar error to this: "Sys.WebForms.PageRequestManagerServerErrorException:true" in javascript error window.

    We are opening a form in a div tag as a apopup window. It works fine if their is no validatin error. As soon as you get a validation error  like "Please enter the name", you will start getting this error on every submit. It is also sopping the page to submit….Any Idea?

    Thanks in Advance

    -Shreyash