Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1410
Validation of viewstate MAC failed on pages using Infragistics webdropdown
posted

Hi,

I have around 60 pages in my application. Out of which, I am using Infragistics webdropdown on 13 pages. The dropdown version is 12.1.20121.1005. Recently, I got a requirement to encrypt the viewstate for my application as it was only Base-64 encoded by default. I included a tag "ViewStateEncryptionMode=always" in web.config. After doing that, I found that all of the pages are functioning properly, but as soon as I click on a page using Infragistics webdropdown, I get the below exception: FYI, I have disabled viewstateMAC on all of the pages but still getting the same issue only on these 13 pages.

 I am using a defined machine key for encryption in the web.config and my application is not a web farm. Since, I am seeing this exception only on pages having webdropdown, this makes me think if there is something in the design of webdropdon which is triggering this exception.

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.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: 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.

[ViewStateException: Invalid viewstate.
Client IP: 127.0.0.1
Port:
Referer: http://localhost:49677/APPLICATIONNAME/PAGE.aspx?Menu=WI
Path: /APPLICATIONNAME/PAGE.aspx
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2; .NET4.0C; .NET4.0E; PRU_IE)
ViewState: aQ7noZuaXWuJ8xkL46f3p6UqKODAT5kdBepkB7QhF9EaceeD4shqb/0bjK/3I2VSiIwWz+OJrHuKW/ZlaVUDAUHouhJwrWQCH6iHAJ0hFUIrJPK3toPGMTY91bXqFZ6I5gAM5jyPi0hiWffNGhMbGkK6Mws7abPFhkA15dqpUTJEr7nmntHtNynReIvh+bJDVK0CSnQyVpVfAhDe0yffK35DYf5BUOBPz/qG+kjhh+FyHiSM7dmbHIbpmV/1JQqV7VC3nwe5Z1OLtGgdQrA6+0kMqT0rcjz5+r8yZy2JQjXew16BSa5O+O535nUlvTxpi+U9/gPIj+zmbJ6MQgTFmeoE1ISUu/SQHTJVYyD8uZ+JFSw6jGnzqrqm7GwBziUEP//BHXAAuTFvasK4QL22Kvj4rMsJfPGtZriTABgZKs2M2zjo32aRPxEdkYX5dLgt01EeBLQIMdfG5IpIHyScrv/jZtbIZs2qm5r5xfdmNAjSNNKyi1RvBp08KkbClHq952SqXShvIWoWN2BCJzxQSu5uHvqifZ4DMfdDkRcButikm1BihWWz6K8y9wHKFl8lYGVgTQWjSkW6h354rqNcZVCAeoxQLi8asFf4thH0hCOgI8CtOeYkNz70JKNF70x4P8GR54UFPPoBdOJg3IFwlpT0UydrNwxYGTglh...]

[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) +235
   System.Web.UI.ViewStateException.ThrowMacValidationError(Exception inner, String persistedState) +14
   System.Web.UI.ObjectStateFormatter.Deserialize(String inputString) +274
   System.Web.UI.ObjectStateFormatter.System.Web.UI.IStateFormatter.Deserialize(String serializedState) +4
   System.Web.UI.Util.DeserializeWithAssert(IStateFormatter formatter, String serializedState) +37
   System.Web.UI.HiddenFieldPageStatePersister.Load() +241
   System.Web.UI.Page.LoadPageStateFromPersistenceMedium() +106
   System.Web.UI.Page.LoadAllState() +43
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +8431
   System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +253
   System.Web.UI.Page.ProcessRequest() +78
   System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +21
   System.Web.UI.Page.ProcessRequest(HttpContext context) +49
   ASP.icasdet_aspx.ProcessRequest(HttpContext context) +37
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +100
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75