Click here to Skip to main content
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 1: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 DamithSL 325
1 OriginalGriff 199
2 BillWoodruff 170
3 Zoltán Zörgő 165
4 Maciej Los 123
0 OriginalGriff 7,854
1 DamithSL 5,949
2 Sergey Alexandrovich Kryukov 5,449
3 Maciej Los 5,084
4 Kornfeld Eliyahu Peter 4,539


Advertise | Privacy | Mobile
Web03 | 2.8.141223.1 | Last Updated 22 Feb 2013
Copyright © CodeProject, 1999-2014
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