Validation of Viewstate MAC Error - Blank Searches
Validation of Viewstate MAC Error - Blank Searches
This is the only time I'm able to reproduce the error and it doesn't happen everytime, but if I continually search for something on my website that doesn't exist, it will eventually give me the viewstate error.
I have already added a machinekey to the web.config but am still able to reproduce the error.
I also tried changing the encryption.config file as suggested in one of the other threads.
Any suggestions?
I have already added a machinekey to the web.config but am still able to reproduce the error.
I also tried changing the encryption.config file as suggested in one of the other threads.
Any suggestions?
Re: Validation of Viewstate MAC Error - Blank Searches
Our client has noticed the same intermittant problem - the error reads:
Failed to load viewstate. The control tree into which viewstate is being loaded must match the control tree that was used to save viewstate during the previous request
- jmestep
- AbleCommerce Angel
- Posts: 8164
- Joined: Sun Feb 29, 2004 8:04 pm
- Location: Dayton, OH
- Contact:
Re: Validation of Viewstate MAC Error - Blank Searches
I ran into a problem on certain browsers:
viewtopic.php?f=42&t=9841&hilit=viewstate+mac
Also, do you have any forms on the page that you have entered, like an email sign up form? If you have and have entered <form> tags around it, that could be causing the problem since the pages automatically generate a form for the entire page.
viewtopic.php?f=42&t=9841&hilit=viewstate+mac
Also, do you have any forms on the page that you have entered, like an email sign up form? If you have and have entered <form> tags around it, that could be causing the problem since the pages automatically generate a form for the entire page.
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
Re: Validation of Viewstate MAC Error - Blank Searches
It was in IE7 - and it was a product page that produced the error.
I've asked the client for more details the next time that the error occurs.
In the meantime I've followed your advice and added the machinekey - handy posting that - thanks
I've asked the client for more details the next time that the error occurs.
In the meantime I've followed your advice and added the machinekey - handy posting that - thanks

Re: Validation of Viewstate MAC Error - Blank Searches
I've already used the tool in the Wiki to add the machinekey, not sure if this helps but here is the stack trace in the error:
I also tried changing the encription.config from
to
Thanks for the suggestion Judy, but I do not have any custom forms on the page.
Aside from disabling the viewstate, is there anything else that could be causing this?
Code: Select all
System.Web.Configuration.MachineKeySection.GetDecodedData(Byte[] buf, Byte[] modifier, Int32 start, Int32 length, Int32& dataLength) +437
System.Web.UI.ObjectStateFormatter.Deserialize(String inputString) +291
Code: Select all
<encryption />
Code: Select all
<encryption></encryption>>
Aside from disabling the viewstate, is there anything else that could be causing this?
Re: Validation of Viewstate MAC Error - Blank Searches
Also, I'm not sure if this is related, but I can't access my EncryptionKey.aspx
When I attempt to load the page, it asks me to login again, when I enter my credentials the login page just refreshes.
When I attempt to load the page, it asks me to login again, when I enter my credentials the login page just refreshes.
Re: Validation of Viewstate MAC Error - Blank Searches
Not from what I can tell, but maybe you see differently, here is my full stack trace:
Code: Select all
[HttpException (0x80004005): Unable to validate data.]
System.Web.Configuration.MachineKeySection.GetDecodedData(Byte[] buf, Byte[] modifier, Int32 start, Int32 length, Int32& dataLength) +437
System.Web.UI.ObjectStateFormatter.Deserialize(String inputString) +291
[ViewStateException: Invalid viewstate.
Client IP: 192.168.10.11
Port: 2251
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.2; WOW64; GTB5; .NET CLR 2.0.50727; InfoPath.1)
ViewState: 9+EyfvAQJZRZlYPgp/oXPLj93folmQfQK5+dICtMBNLMd+CDwyvSxjYmRLakZf3328YpU3ZtQVrq5hMCIRhBG0rkW1TT/UNRETeo8XKdI5IvfTHgrPAl4e7pXlF9qzz0yH3q/PXLkyViIms9y7vFmvW8WBocbq3NJEi86WNo/DHzATRWOFX1B1uXpdCzl3pYCTi4qi+TBWOZjv4sAlOq7G2ZAq0CVkrzpoe+Kc/lIHtORksDlTBjSNoNZZnyBriU1gRCHUG3t0Eabx69TuFlCFfHhAsKdZsWYa83XfPg1ofd0JiXOzpD774cFe7VZhmcN2FuFlrNeg5REjpJpcmoaprU5GKFFHxwcOM3Z0cW1+AGLwwLBMuxGJz5khME5dFgkMjG8h92FsgtE9KqYehdUOSW6d+xhsAQo7vPIVII71ZJuQMCZxvSkuhtb0U2uOjk2sUkwTlq9yH4j9To/uc6U5sGpbMcoudPj9+SZErPWGGp8kBr7aKZKq7FmlSQ3l6xvwY6fD+VJ2nfqymdQsVWoCaa97TTcam845E8JclpHaxhthzqY1oMNCrm1Ft4OKFKHu8iR2IMFn+qWNF8FYSz0dTzTW0zi+dynL3bBSvp2vyO7q1hplNJhD8phdrUJwaKCmjo1lIKzdAm6a1Vmj1jWRGCqJ1Q92h8vzyl3pdz9v5zW/PygDOyTku6fSbXaoS2+nVseClV+VDK7Lfakx6mHL3gHC3f58RSUFzpb1qiHIwa4HobAB0dSYKrcFE7lOWf7rOhXz/DWjx0EVR9061IltJG0y1kHyGzLRQ5KWYW+X1JeMFymajByqmmDsUNVMvgjZWifVY7P8bzHH8nYB5wXTegi...]
[HttpException (0x80004005): 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.]
System.Web.UI.ViewStateException.ThrowError(Exception inner, String persistedState, String errorPageMessage, Boolean macValidationError) +163
System.Web.UI.ObjectStateFormatter.Deserialize(String inputString) +554
System.Web.UI.Util.DeserializeWithAssert(IStateFormatter formatter, String serializedState) +88
System.Web.UI.HiddenFieldPageStatePersister.Load() +264
System.Web.UI.Page.LoadPageStateFromPersistenceMedium() +279
System.Web.UI.Page.LoadAllState() +44
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5268
System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +236
System.Web.UI.Page.ProcessRequest() +105
System.Web.UI.Page.ProcessRequest(HttpContext context) +292
ASP.search_aspx.ProcessRequest(HttpContext context) +16
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +499
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +177
- jmestep
- AbleCommerce Angel
- Posts: 8164
- Joined: Sun Feb 29, 2004 8:04 pm
- Location: Dayton, OH
- Contact:
Re: Validation of Viewstate MAC Error - Blank Searches
I do remember also reading something on view state that it can be corrupted if the page doesn't finish loading before something else on it is clicked.
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
Re: Validation of Viewstate MAC Error - Blank Searches
Only if you move ViewState to the bottom of the page. Normally, ASP.NET puts it at the top so the browser renders it before any controls that can cause a postback. If you move ViewState to the bottom, then the controls are rendered before the ViewState. If you click on one of those elements before ViewState then the postback will not have a valid ViewState and you will get this error.jmestep wrote:I do remember also reading something on view state that it can be corrupted if the page doesn't finish loading before something else on it is clicked.
Unfortunately, this is only one of possibly dozens of reasons the ViewState could be corrupted.