Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

SERVER ERROR - UNABLE TO VALIDATE DATA

Posted on 2005-02-19
2
44,410 Views
Last Modified: 2011-08-18
Does anyone know how to correct this? and if so... How?


Server Error in '/' Application.
--------------------------------------------------------------------------------

Unable to validate data.
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: Unable to validate data.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[HttpException (0x80004005): Unable to validate data.]
System.Web.Configuration.MachineKey.GetDecodedData(Byte[] buf, Byte[] modifier, Int32 start, Int32 length, Int32& dataLength) +195
System.Web.UI.LosFormatter.Deserialize(String input) +60

[HttpException (0x80004005): Authentication of viewstate failed. 1) If this is a cluster, edit <machineKey> configuration so all servers use the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster. 2) Viewstate can only be posted back to the same page. 3) The viewstate for this page might be corrupted.]
System.Web.UI.LosFormatter.Deserialize(String input) +118
System.Web.UI.Page.LoadPageStateFromPersistenceMedium() +102

[HttpException (0x80004005): Invalid_Viewstate
Client IP: 69.194.58.179
Port: 1216
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; FunWebProducts-MyWay; SV1; .NET CLR 1.1.4322; .NET CLR 1.0.3705)
ViewState: dDwtMzgwNjA1Nzc2O3Q8O2w8aTwzPjs+O2w8dDw7bDxpPDE+O2k8Mz47aTw3PjtpPDk+Oz47bDx0PHA8cDxsPFRleHQ7PjtsPFw8aW1nIHNyYz0ndG9wSW1hZ2VzLzMuanBnJyB3aWR0aD0nNzkwJyBoZWlnaHQ9JzE1MSdcPjs+Pjs+Ozs+O3Q8cDxwPGw8VGV4dDs+O2w8XDxhIGhyZWY9J2xvZ2luLmFzcHgnXD5Mb2dpblw8L2FcPjs+Pjs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DQtMjAwNTtNci4gU3RlcG9uYXM7Mi8xNy8yMDA1IDEyOjAwOjAwIEFNOz47Oz47Pj47Pj47dDw7bDxpPDE+Oz47bDx0PDtsPGk8MT47aTwyPjs+O2w8dDxwPHA8bDxDb21tYW5kQXJndW1lbnQ7PjtsPDEzMTg7Pj47PjtsPGk8MD47PjtsPHQ8QDwxMzE4Oz47Oz47Pj47dDxAPFNlbWkgMjAwNC0yMDA1O01yLiBTdGVwb25hczsyLzE3LzIwMDUgMTI6MDA6MDAgQU07Pjs7Pjs+Pjs+Pjt0PDtsPGk8MT47PjtsPHQ8O2w8aTwxPjtpPDI+Oz47bDx0PHA8cDxsPENvbW1hbmRBcmd1bWVudDs+O2w8MTMxNzs+Pjs+O2w8aTwwPjs+O2w8dDxAPDEzMTc7Pjs7Pjs+Pjt0PEA8U2VtaSAyMDA0LTIwMDU7TXIuIFN0ZXBvbmFzOzIvMTcvMjAwNSAxMjowMDowMCBBTTs+Ozs+Oz4+Oz4+Oz4+Oz4+Oz4+O3Q8QDA8cDxwPGw8VmlzaWJsZTs+O2w8bzxmPjs+Pjs+Ozs7Ozs7Ozs7Oz47Oz47Pj47Pj47PgFLQAUmFCiJAwMBfnV6V0F5IuFF
Http-Referer: http://www.etobicokeci.com/newPictures.aspx 
Path: /newPictures.aspx.]
System.Web.UI.Page.LoadPageStateFromPersistenceMedium() +448
System.Web.UI.Page.LoadPageViewState() +18
System.Web.UI.Page.ProcessRequestMain() +447




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET Version:1.1.4322.2032
0
Comment
Question by:bonfire89
2 Comments
 
LVL 58

Accepted Solution

by:
amit_g earned 250 total points
ID: 13354457
That happens because the key used to encrypt/decrypt view state got changed. This could happen if you are using a web farm (load balanced web servers) or the user kept the page open for a long duration.

Give fixed value in machineKey section in web.config ...

<configuration>
<system.web>
<machineKey validationKey='A96B2F3BF50A1A2A1B81214A550B89F2A318B3712FB5AC8CD82AF4F3925B3C6ED58CF5F38503629A78BF8C27B1B736C4E84DACE342AB83A42932B44EBC3D7601'  
   decryptionKey='D01201C69DF5E9863133028CBD4E6EEFC45B5E609D7F4107'   validation='SHA1'/>
...
...

The default value for it is ...

<machineKey validationKey="AutoGenerate,IsolateApps"
            decryptionKey="AutoGenerate,IsolateApps"
            validation="SHA1"/>

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/gngrfmachinekeysection.asp

Make sure to follow minimum key length for the validation method used. Follow instructions in the above article.

You could also acheive the same by disabling the enableViewStateMac.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/gngrfpagessection.asp
0
 
LVL 1

Author Comment

by:bonfire89
ID: 13359319
fantastic... that helped a lot!
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question