We help IT Professionals succeed at work.
Get Started

Validation of viewstate MAC failed? How I fix it?

rperezretana
rperezretana asked
on
1,513 Views
Last Modified: 2013-11-08
I am getting an exception, but I dont know how to fix it, and why I am getting this error.


strMessage=

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.

_____________________________________

strInnerException=

System.Web.UI.ViewStateException: Invalid viewstate.
Client IP: 89.130.13.104
Port: 4938
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; MRSPUTNIK 2, 3, 0, 104; MRA 5.6 (build 03402); .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
ViewState: /wEPDwUKMTA3MzA5OTI2OQ9kFgJmD2QWAgIDD2QWCAIGD2QWUAIBDw8WBh4EVGV4dAUPSSBnb3QgYSBmZWVsaW5nHgtOYXZpZ2F0ZVVybAVxLi4vbW9zdHJhci5hc3B4P2NhbmNpb249b2ZfSV9nb3RfYV9mZWVsaW5nX0JsYWNrX0V5ZWRfUGVhY2UmZmVhdHVyZT1SZWxfNDFfVm9pc19TdXJfVG9uX0NoZW1pbl9MZXNfQ2hvcmlzdGVzX2FsbDAeB1Zpc2libGVnZGQCAw8PFgYfAAUQQmxhY2sgRXllZCBQZWFjZR8BBScuLi9hcnRpc3RhLmFzcHg/bm9tYnJlPUJsYWNrIEV5ZWQgUGVhY2UfAmdkZAIFDw8WBh8ABS5QaXJhdGVzIG9mIHRoZSBDYXJpYmJlYW4gKFBpcmF0YXMgRGVsIENhcmliZSApHwEFfy4uL21vc3RyYXIuYXNweD9jYW5jaW9uPWtuX1BpcmF0ZXNfb2ZfdGhlX0NhcmliYmVhbl8oUGlyYXRhc19EZWxfQ2FyaWJlXykmZmVhdHVyZT1SZWxfNDFfVm9pc19TdXJfVG9uX0NoZW1pbl9MZXNfQ2hvcmlzdGVzX2FsbDEfAmdkZAIHDw8WBh8ABRJQaXJhdGFzIERlbCBDYXJpYmUfAQUpLi4vYXJ0aXN0YS5hc3B4P25vbWJyZT1QaXJhdGFzIERlbCBDYXJpYmUfAmdkZAIJDw8WBh8ABRxCaWcgR2lybCAoWW91IEFyZSBCZWF1dG... ---> System.Web.HttpException: Unable to validate data.
at System.Web.Configuration.MachineKeySection.GetDecodedData(Byte[] buf, Byte[] modifier, Int32 start, Int32 length, Int32& dataLength)
at System.Web.UI.ObjectStateFormatter.Deserialize(String inputString)
--- End of inner exception stack trace ---

_____________________________________

strStackTrace=

at System.Web.UI.ViewStateException.ThrowError(Exception inner, String persistedState, String errorPageMessage, Boolean macValidationError)
at System.Web.UI.ViewStateException.ThrowMacValidationError(Exception inner, String persistedState)
at System.Web.UI.ObjectStateFormatter.Deserialize(String inputString)
at System.Web.UI.ObjectStateFormatter.System.Web.UI.IStateFormatter.Deserialize(String serializedState)
at System.Web.UI.Util.DeserializeWithAssert(IStateFormatter formatter, String serializedState)
at System.Web.UI.HiddenFieldPageStatePersister.Load()
at System.Web.UI.Page.LoadPageStateFromPersistenceMedium()
at System.Web.UI.Page.LoadAllState()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at ASP.mostrar_aspx.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)



I already have the code this:


  <system.web>
<pages enableViewStateMac="false" />

In my web.config. but it still happens.

Any help?
Comment
Watch Question
CERTIFIED EXPERT
Commented:
This problem has been solved!
Unlock 1 Answer and 4 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE