Click here to Skip to main content
11,647,810 members (60,793 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET
Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that 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:
 

[No relevant source lines]
 

Source File: c:\windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\830e56f9\3fcc7360\App_Web_km5ksyv2.0.cs    Line: 0
 
Stack Trace:
 

[ViewStateException: Invalid viewstate.
    Client IP: 122.172.166.65
    Port: 18849
    Referer: http://apps-cobblestones.in/login/Logint.aspx?
    Path: /login/Logint.aspx
    User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:18.0) Gecko/20100101 Firefox/18.0
  
 

 

 
       Already i had hosted my application at that time it was running but after some times it's not work properly.Plz can any one help me  How can Solve this Problem?
Posted 20-Feb-13 0:18am
NarenDx382
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

That error raise when some risky charecter found in Http Request object. You can ignore that by skiping validation but it is not recommended. You can skip validation check by setting ValidatinonRequestProperty to false and EnableViewStateMac to false in page directives in markup file.example
<![CDATA[<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="About.aspx.cs" Inherits="WebApp2010.About" ValidateRequest="false" EnableViewStateMac="false" %>]]>
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Kindly use
<pages enableviewstatemac="false"></pages>
in web.config
Hope this helps
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 jyo.net 500
1 F-ES Sitecore 410
2 DamithSL 290
3 CPallini 290
4 OriginalGriff 277
0 OriginalGriff 1,342
1 jyo.net 994
2 DamithSL 971
3 Sergey Alexandrovich Kryukov 873
4 CPallini 845


Advertise | Privacy | Mobile
Web01 | 2.8.150804.4 | Last Updated 22 Feb 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100