Server Error in Application

An unhandled exception occurred during the execution of the current web request
posts - 60, comments - 75, trackbacks - 50

My Links

News

Archives

Post Categories

ASP.NET

Validation of viewstate MAC failed / The state information is invalid for this page and might be corrupted

The error caused by an ASP.net 2.0 feature named Event Validation. This is a security feature ensures postback events allowed and created by the server to help prevent spoofed postbacks. This feature is implemented by having controls register valid events when they render. The end result is that at the bottom of your rendered

tag, you'll see something like this:

 

When a postback occurs, ASP.net uses the values stored in this hidden field to ensure that the button you clicked invokes a valid event. If it's not valid, you get the exception that you've been seeing.

This problem occurs specifically when you postback before the EventValidation field has been rendered. In my case there was one extra tag. If EventValidation is enabled (by default), but ASP.NET not able to see the hidden field when you postback, you also get the exception. If you submit a form before it has been entirely rendered, then chances are the EventValidation field has not yet been rendered, and thus ASP.net cannot validate your click.

One work around is of course to just disable event validation, but you have to be aware of the security issues.

In my case there was one extra tag. i removed this and my problem was solved.

I hope this will help others!..

Cheers!....

Mahesh Singh

maheshsingh21@hotmail.com


Related Post:

Association, Aggregation, Composition object relationship

Talent vs Attitude – Harsha Bhogle

What we can learn from Babies

 

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Print | posted on Friday, September 22, 2006 6:41 AM | Filed Under [ ASP.NET C# Web Services Design Pattern BizTalk unhandled exception ]

Feedback

Gravatar

# re: Validation of viewstate MAC failed / The state information is invalid for this page and might be corrupted

You need to encode your html so it renders the way you want.
10/4/2006 6:43 PM | bmm6o
Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification:
 
 

Powered by: