scm0sml
asked on
Validation of viewstate MAC failed when taking a while to postback
I have ap age that has a number of dropdowns and textboxes that allow a user to enter a football team and the result of a fixture.
if you entyer the information quickly then every thing works fine and the page saves correctly.
however if you take a while to click the save button when you do so you get the error:
Server Error in '/' Application.
-------------------------- ---------- ---------- ---------- ---------- ---------- ----
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.
Source Error:
I've tried reading up on this and the only thing that i thought may be applicable to me is the recycling of the application pool?
does this sound likely?
the user doesnt have too take an excessive long time to get this error so i need to get it sorted as it is becoming an iusse.
any ideas? i will post the full error page below
if you entyer the information quickly then every thing works fine and the page saves correctly.
however if you take a while to click the save button when you do so you get the error:
Server Error in '/' Application.
--------------------------
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.
Source Error:
I've tried reading up on this and the only thing that i thought may be applicable to me is the recycling of the application pool?
does this sound likely?
the user doesnt have too take an excessive long time to get this error so i need to get it sorted as it is becoming an iusse.
any ideas? i will post the full error page below
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
ok i will try that once i get in later.
do you mind giving me a brief explanation of the problem and how your link fixes it tho?
do you mind giving me a brief explanation of the problem and how your link fixes it tho?
ASKER
this seems to have fixed the issue, the link you gave creates the key but there is no real explanation as to why i need it or what the problem was in the first place.
can you just give me a brief overview of the prob and how this key fixes it.
thanks
can you just give me a brief overview of the prob and how this key fixes it.
thanks
The explanation is explained in the error:
"this application is hosted by a Web Farm or cluster . . ."
there is nothing more to explain about it.
"this application is hosted by a Web Farm or cluster . . ."
there is nothing more to explain about it.
Also, my solution solved the problem:
"this seems to have fixed the issue . . " - from scm0sml
"this seems to have fixed the issue . . " - from scm0sml
ASKER
--------------------------
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.
Source Error:
The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL:
1. Add a "Debug=true" directive at the top of the file that generated the error. Example:
<%@ Page Language="C#" Debug="true" %>
or:
2) Add the following section to the configuration file of your application:
<configuration>
<system.web>
<compilation debug="true"/>
</system.web>
</configuration>
Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode.
Important: Running applications in debug mode does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario.
Stack Trace:
[HttpException (0x80004005): Unable to validate data.]
System.Web.Configuration.M
System.Web.UI.ObjectStateF
[ViewStateException: Invalid viewstate.
Client IP: 90.199.172.112
Port: 63763
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.0.04506; InfoPath.2)
ViewState: /wEPDwUJNjEzMDY3ODk3D2QWAm
[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.ViewStateExc
System.Web.UI.ObjectStateF
System.Web.UI.ObjectStateF
System.Web.UI.Util.Deseria
System.Web.UI.HiddenFieldP
System.Web.UI.Page.LoadPag
System.Web.UI.Page.LoadAll
System.Web.UI.Page.Process
System.Web.UI.Page.Process
System.Web.UI.Page.Process
System.Web.UI.Page.Process
System.Web.UI.Page.Process
ASP.admin_newresult_aspx.P
System.Web.CallHandlerExec
System.Web.HttpApplication
--------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42