Fixing the Validation of viewstate MAC failed error issue.

This is just a quickie to see if that helps anybody. The GridView in GeoTwitter had a problem as was using the DataKeyNames. I was getting the error on the viewstate MAC failed error. Looks like adding the code below on the web.config fix the issue.

<pages enableEventValidation="false" viewStateEncryptionMode="Never">

The problem now is I don’t have a validation for the viewstate, that’s a security problem in my modest opinion, I found this resource below that help me to understand a little bit more what the MAC failed error is:

Great blog post found here: Resources to fix the issue.

Hope it helps you too.

Cheers

Al

Published Monday, August 11, 2008 11:09 PM by albertpascual
Filed under: , , ,

Comments

# funny wallpaper &raquo; Fixing the Validation of viewstate MAC failed error issue.

Pingback from  funny wallpaper &raquo; Fixing the Validation of viewstate MAC failed error issue.

# carnewsservice.info &raquo; Fixing the Validation of viewstate MAC failed error issue.

Pingback from  carnewsservice.info &raquo; Fixing the Validation of viewstate MAC failed error issue.

# re: Fixing the Validation of viewstate MAC failed error issue.

Sunday, November 16, 2008 7:23 AM by shadyscience

<pages enableEventValidation=“false“ viewStateEncryptionMode =“Never“

This is known to be a security risk and in my case it didn’t fix the problem.

I think I found another way to eliminate the Error, add this to your Button which triggers the Postback Event:

PostBackUrl=”~/yoursite.aspx”

Just post it back to the same site explicitly and you should be fine.

copied...

# re: Fixing the Validation of viewstate MAC failed error issue.

Tuesday, December 16, 2008 5:02 AM by Spider

<Page enableEventValidation=“false“ viewStateEncryptionMode =“Never“ >

after adding this, still the same error comes!!!

# re: Fixing the Validation of viewstate MAC failed error issue.

Wednesday, February 11, 2009 6:54 PM by a

shadyscience's comments fixed my error

PostBackUrl=”~/yoursite.aspx”

thanks!!

# re: Fixing the Validation of viewstate MAC failed error issue.

Thursday, March 05, 2009 3:30 AM by Prasad

I am Facing The Following Error  Please help me out...

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.

# re: Fixing the Validation of viewstate MAC failed error issue.

Thursday, March 19, 2009 12:41 AM by AK

In web.config add

<pages enableViewStateMac ="false">

Hope this helps..

# re: Fixing the Validation of viewstate MAC failed error issue.

Tuesday, April 21, 2009 2:01 PM by Tim

And we've been arguing for HOW MANY YEARS on all of the highly situational *fixes* on this problem from a plethora of *experts* ... Change the web.config, change the page properties, force a postback URL .... ugh ...

# re: Fixing the Validation of viewstate MAC failed error issue.

Thursday, May 07, 2009 2:02 PM by FreeDubaiClassified team

When i tried to integrate Google search box with asp.net 2.0 page in www.freedubaiclassified.com, but service pack sp1 with 3.0 have installed in my  system, i am getting Validation of viewstate MAC failed error.

plz advice to resolve the issues.

# re: Fixing the Validation of viewstate MAC failed error issue.

Friday, June 05, 2009 5:45 AM by sharath

thanks

# re: Fixing the Validation of viewstate MAC failed error issue.

Monday, February 08, 2010 6:02 AM by Junaid Ahmed Siddiqui

In web.config add

<pages enableViewStateMac ="false">

It worked I am very grateful to you. Thanks Alot

# re: Fixing the Validation of viewstate MAC failed error issue.

Thursday, August 05, 2010 3:04 AM by Keerthy

Can any one HELP me in GENERATING THE ERROR "Validation of viewstate MAC" please...

# re: Fixing the Validation of viewstate MAC failed error issue.

Friday, October 15, 2010 3:42 PM by tane

sahdyscience´s answer really helped me  with this problem...thanks

# re: Fixing the Validation of viewstate MAC failed error issue.

Thursday, October 28, 2010 7:56 AM by Halby

I am facing the same problem only with one client system. rest everywhere it works fine.

# re: Fixing the Validation of viewstate MAC failed error issue.

Friday, March 04, 2011 2:31 PM by gabernathy

I have the same issue on a page with several updatepanels.  I assume the issue is as described in the referenced link (an updatepanel is posting back before the hidden field is rendered).  I am setting enableViewStateMac="false" to see if it will correct it.

# re: Fixing the Validation of viewstate MAC failed error issue.

Thursday, April 21, 2011 4:44 AM by Huy Tran

thank a lot, it worked ^_^

# re: Fixing the Validation of viewstate MAC failed error issue.

Friday, May 13, 2011 8:13 AM by weblogs.asp.net

Fixing the validation of viewstate mac failed error issue.. Slap-up :)

# re: Fixing the Validation of viewstate MAC failed error issue.

Sunday, May 22, 2011 12:51 AM by Mominul

In web.config add

<pages enableViewStateMac ="false">

It worked I am very grateful to you. Thanks.

# re: Fixing the Validation of viewstate MAC failed error issue.

Monday, June 27, 2011 1:24 PM by weblogs.asp.net

Fixing the validation of viewstate mac failed error issue.. Great idea :)

# re: Fixing the Validation of viewstate MAC failed error issue.

Saturday, September 10, 2011 5:14 AM by balwant

u can run the .net set up it will help and revolve the work

# re: Fixing the Validation of viewstate MAC failed error issue.

Wednesday, September 14, 2011 9:20 PM by linux_nd

Thanks!. It's worked

# re: Fixing the Validation of viewstate MAC failed error issue.

Tuesday, September 20, 2011 2:03 AM by Muthukumar Nadar

<pages enableViewStateMac ="false">

worked for me.

Thanx buddy...

# re: Fixing the Validation of viewstate MAC failed error issue.

Wednesday, November 16, 2011 6:23 AM by mohit

<pages enableViewStateMac ="false">

# re: Fixing the Validation of viewstate MAC failed error issue.

Friday, January 27, 2012 2:14 AM by icmt college

<pages enableViewStateMac ="false">

# re: Fixing the Validation of viewstate MAC failed error issue.

Thursday, April 12, 2012 9:16 AM by rocker

where do we add that line in web.config ?

# re: Fixing the Validation of viewstate MAC failed error issue.

Sunday, May 13, 2012 3:18 PM by tonnyc

The setting should be in the <system.web> section of your wen.config file

Leave a Comment

(required) 
(required) 
(optional)
(required)