+1-888-365-2779
Try Now
More in this section

Forums / 3.x Pre-release forums (retired) / ViewState Page Nav

ViewState Page Nav

7 posts, 0 answered
  1. Paul Berger
    Paul Berger avatar
    61 posts
    Registered:
    03 Apr 2006
    26 Feb 2007
    Link to this post
    Hi Guys

    I was navigating through the pages on sitefinity and got a viewstate issue. I think I clicked multiple pages before they loaded.

    Server Error in '/HappenWeb3RC' 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:

    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.MachineKeySection.GetDecodedData(Byte[] buf, Byte[] modifier, Int32 start, Int32 length, Int32& dataLength) +2549724
       System.Web.UI.ObjectStateFormatter.Deserialize(String inputString) +214
    
    [ViewStateException: Invalid viewstate. 
    	Client IP: 127.0.0.1
    	Port: 39127
    	User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1
    	ViewState: G2Flelx5k08PbqSKo75sslXtB6C86z6gAdMuIzyh7X2GwTkQsy0Gxmq6JL82lJOYzVxY+1yejHw56cvis6ruaoddWXMV7bJu2qAxO+66Uh6Tfk2TsMuivo2VvSNbQZ2kDk0NNdEaSeWPpvr3zly0RdkHBOrrAU/v7es7Yn3yoSLF/3oylvrsNeVguEZeJ5I47dqp2L18dr+r9sSGUlVJf1XtCkLxeOJpOwtKF/pWTeRnRAmCLRXtZF1msX19RHXmhqABeLjVYBs3F3DHK4yZ8wf8K4Cm5k9jN6llDP31w+SBF7mbHwoo+Wu8D7dFvkONw48oWNasLj7SSO9pkoTJClNgJGf4hTqt2AZmFQsCZT+CWTz5w39QH/MDAbji4HB/GixZFMy6K604XDbFCkSLS/oinVlpbw1cI4S9KGmBWCiBu0wgtLMXz/oDYREDYxJiPD2WT1d7oPtPVF0SUhmBjeALS/t9GnZdaH8JDxuts51UwE1ej3zlgnL4+8Re7hDcdLyJQ0ltEOp9k2CK4ZobirY76KacISd4eIBGotzFUvCdfKe7jZ7wSvNuig7JVCtotPyYJN76hfj1qcCgwKEH19got+71cR3K7aNXO3ZXdh7X8HZjxlJnj6v/VudK9Btc2dYKnm58d65UyFd2M+RtpIp8A7BxYNLLHCMdZX9pGV4CZtVLrKNfIJzp/Wijg941c8cuCFpF0o4H9aKXMTqL2uXwwwprPTVKj2kNVw9xLjVA9r+MW60yQZgjXbiey/qGZgN61o9ehxMYE21Qn6KBd3Cn9UecNXH79PY48rFWHIgGLgLZkr7QRicuTOtXZeQbNEht9Fsv/4JJhadn5Z/rN6waKy61rBBhK...]
    
    [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) +116
       System.Web.UI.ObjectStateFormatter.Deserialize(String inputString) +251
       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() +220
       System.Web.UI.Page.LoadPageStateFromPersistenceMedium() +83
       System.Web.UI.Page.LoadAllState() +35
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6953
       System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +154
       System.Web.UI.Page.ProcessRequest() +86
       System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +18
       System.Web.UI.Page.ProcessRequest(HttpContext context) +49
       ASP.admin_pages_aspx.ProcessRequest(HttpContext context) +4
       System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +154
       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64
    


    Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.210
  2. Paul Berger
    Paul Berger avatar
    61 posts
    Registered:
    03 Apr 2006
    26 Feb 2007
    Link to this post
    To reproduce try QUICKLY clicking back and fourth between a child and parent page.
  3. Hrisi
    Hrisi avatar
    34 posts
    Registered:
    28 Sep 2016
    26 Feb 2007
    Link to this post
    Hello Paul,

    Unfortunately, we could not reproduce the issue you reported. However, it seems to be related to ASP.net 2.0 feature called Event Validation. You may find the discussion below useful.
    http://forums.asp.net/thread/1173230.aspx
    Please have a look at Eilon's answer. Currently, we do not have plans to workaround this problem.

    Regards,
    Hrisi
    the telerik team
  4. Paul Berger
    Paul Berger avatar
    61 posts
    Registered:
    03 Apr 2006
    28 Feb 2007
    Link to this post
    Actually it is more likely to be a ajax request Issue...

    Why would you not fix an Issue?

    To reproduce try QUICKLY clicking back and fourth between a child and parent page.

    Try harder to reproduce this Issue, do not be lazy.


  5. Sean
    Sean avatar
    271 posts
    Registered:
    31 May 2006
    28 Feb 2007
    Link to this post
    Paul,

    I think it is a little unfair to start insulting Telerik as this issue cleary isn't something they have deliberately done, I mean look at the stack trace of the error you sent, do you see any Telerik code being referenced? Nope it is all from System.Web which comes from Microsoft so if you want to call anyone lazy start with them....

    I too can't reproduce your problem so if you could kindly give a bit more detail on where you navigating, eg, within the admin seciton, on the live site using some sort of navigation that causes post backs (there is also hardly any ajax being used in sitefinity by the way), or navigating through the page editor?

    If you want to check if it is in fact EventValidation that is causing your problem you can add to your web config this code:

    <pages enableEventValidation="false"></pages>

    You must put that between your <system.web> tags otherwise it won't work.  That should at least help you rule out it being that if you are so convinced it is something else.

    Hope that helps.
    Sean

  6. Paul Berger
    Paul Berger avatar
    61 posts
    Registered:
    03 Apr 2006
    03 Mar 2007
    Link to this post

    Sorry, I was not trying to insult anyone.

    I was getting the Issue in the admin section. When clicking in the page nav tree between a child and parent node, and not waiting for it to finish loading before I click the next node.

  7. Kevin Pipher
    Kevin Pipher avatar
    91 posts
    Registered:
    30 Nov 2005
    16 Aug 2007
    Link to this post
    Sorry to bring this thread back up, but I've run into the same issue, where the web server is on a slow connection and periodically throws the exception during postback.

    Are there any concerns or implications of turning off the page level event validation as discussed? I would rather my users not see a big scary exception message, but I don't want to negatively affect the CMS but turning off validation.

    <pages enableEventValidation="false"></pages>


    Because this seems to be a common issue, One possible workaround I thought of is to catch the specific exception in the Application_Error handler of global.asax, and to show a user friendly error page indicating the user should go back and try again?

    What are everyone's thoughts on this?

    Kevin.

Register for webinar
7 posts, 0 answered