Re: problem, viewstate mac

  • From: "RicksPlace" <ofbgmail@xxxxxxxxx>
  • To: <programmingblind@xxxxxxxxxxxxx>
  • Date: Fri, 19 Nov 2010 06:39:33 -0500

By the way, are running asp 2.0 or which version, is your IP Host running the same and do you have the machineKey hard coded and it's related values specified in your config file if you are running on a web farm or other place where execution kmay be broken between postings? There can be several reasons for this type of message and it would be necessary to actually see the code, config file and perhaps get some info from your IP Host to resolve it without just trying suggested solutions and finding one that works for you, inefficient, slow but perhaps your best bet if you don't have access to an experienced pro in this arena. View State, encryption and all that jazz is one of the more complex issues needed to be delt with in Internet Programming and especially for processing split between processes on diferent machines of a Web Farm or other remote or multi-processing situation.. Anyway, See if you have specified a machineKey and the related fields, properties, in the <system.web> section of your config file - at least I have used one for my Website that works fine with some rather complex nested controls and Master Pages. Make sure you don't have 2 <form> statements in your page, make sure you have it in the Details Page - this according to one of the other posts but I had no problem using it in either the Master nor the Detail Page... Hmmm, I can't think of anything else to look at but you should get some ideas from the prior blog I mentiioned and here. I had to specify a machineKey value when I moved my site up to a IP Host if I remember correctly but that was using VS 2005 and several years ago so I do not recall exactly what all it entailed other than that specification.

Rick USA

----- Original Message ----- From: "RicksPlace" <ofbgmail@xxxxxxxxx>
To: <programmingblind@xxxxxxxxxxxxx>
Sent: Friday, November 19, 2010 5:30 AM
Subject: Re: problem, viewstate mac

Hi: Did you read the following group of Postings on this subject? It was one of the first ones I found googling and has a little info about folks having that or a similar problem and a response from a MS guy.
Rick USA
----- Original Message ----- From: "sameer manohtra" <sameermanohtra@xxxxxxxxx>
To: <programmingblind@xxxxxxxxxxxxx>
Sent: Friday, November 19, 2010 3:44 AM
Subject: Re: problem, viewstate mac

well, I read that this is one of the most common problems developer
faces specially while working with gridview controls where data is to
be sought from database.
Wondrously,  I couldn’t find anyone amongst the folks I know who has a
working solution of this nagging issue.
At most of the places, I’ve seen that doing enable viewstate mac
“false” fix the issue, but what am I doing wrong, I get runtime error
on the page everytime I implement this one line.

I’m sure some of you guys must have come across of this problem, as
I’m aware that here we have so many experienced  developers.

Please help me, its muddling  my head and I’m just out of solution.
Any help will be deeply appreciated and will prove of absolute utility.


On 11/19/10, Jacques Bosch <jfbosch@xxxxxxxxx> wrote:
Perhaps you already read these pages, but anyway.

On Thu, Nov 18, 2010 at 4:21 PM, sameer manohtra

Hi guys,
I’ve trapped into a problem yet again:
I’m developing a website using and I have encountered a
problem where i’d like to know from you guys.

I have developed  a page where there’s a gridview control that’s
showing data from the database, and a textbox  and   button that
stores the value in the database.
Its all working fine on my computer (LOCALHOST), but on live server it
seemed to have  messed up.

Simply, when I try to place a text in textbox and click button for add
(which should store the data into database), I get this strange error:
“Validation of viewstate MAC failed. If this application is hosted by
a Web Farm or
cluster, ensure that <machineKey> configuration specifies the same

from some googling I found that this can be fixed by placing following
in web.config:

unfortunately, when I’ve added this to my web.config, the page did not
load and started giving runtime error.

I have even tried to place the same code in .aspx file, result of
which too was similar (RunTime Error).

Does someone have any solution?

Please, share it, I’m in high
Need to do the same.

Any response will be appreciated.

View the list's information and change your settings at

Jacques Bosch

View the list's information and change your settings at

View the list's information and change your settings at

View the list's information and change your settings at

Other related posts: