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.

Published 12 August 08 03:00 by Tom

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# Update for viewstate issues | Easycoded said on August 12, 2008 3:05 PM:

PingBack from http://www.easycoded.com/update-for-viewstate-issues

# Vesta said on August 12, 2008 11:45 PM:

i had this error in vs 2005 what about that?

# Tom said on August 13, 2008 12:59 PM:

Vesta,

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

# Francois Ward said on August 13, 2008 2:11 PM:

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.

# TheXenocide said on August 13, 2008 3:29 PM:

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!

# Mike said on August 18, 2008 8:00 AM:

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?

# Mike said on August 18, 2008 10:44 AM:

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.

# Never doubt thy debugger said on December 23, 2008 5:06 PM:

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

# Paul said on February 1, 2009 6:07 PM:

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...

# vijaykumar_gupta said on June 12, 2009 2:54 AM:

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

Leave a Comment

(required) 
(optional)
(required) 

  
Enter Code Here: Required

Search

This Blog

Syndication

Page view tracker