System.Web.HttpException: Unable to validate data

Source: Internet
Author: User
Tags stack trace
unable to validate data. Description:An unhandled exception occurred during the execution of the current WEB request. Check the stack trace for more information about the error and where the error occurred 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. You can use the following exception stack trace to determine information about the cause of the exception and where it occurred.

Stack trace:

[HttpException (0x80004005): Cannot 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 al Gorithm. AutoGenerate cannot is used in a cluster. 2) Viewstate can only be posted the same page. 3) The ViewState for this page might is corrupted.]
System.Web.UI.LosFormatter.Deserialize (String input) +118
System.Web.UI.Page.LoadPageStateFromPersistenceMedium () +101

[HttpException (0x80004005): invalid_viewstate
Client ip:127.0.0.1
port:1893
user-agent:mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.2;. NET CLR 1.1.4322)
viewstate:ddwxody1njiynza4o3q8o2w8atwwpjs+o2w8ddw7bdxppdexpjtppdezpjs+o2w8ddx0pdtwpgw8atwwpjs+ o2w8cdzlhazlj7jlhoxpg6jlhazmlofkv53lr4y75yws5y+45yaf6yoo5yws5pah5l+d5a+gpjs+pjs+ozs+ o3q8ddw7cdxspgk8md47pjtspha85pmu6ycao+azrumamj47pj47pjs7pjs+pjs+pjs+vqqb2s1cqu9rlhoi9o607b+p3x4=
Http-referer:
Path:/attachcs/upload.aspx.]
System.Web.UI.Page.LoadPageStateFromPersistenceMedium () +447
System.Web.UI.Page.LoadPageViewState () +18
System.Web.UI.Page.ProcessRequestMain () +447

Workaround: Set the Prohibit MAC (authentication code) in the page directive: <% @ Page enableviewstatemac= "false" >   view state Message authentication Code (MAC) is an authentication token (also called Checksum, the code is created when both the authentication scheme and the key are applied to the message. The MAC is calculated and validated by using the same key. Therefore, the MAC can only be validated by a predetermined receiver. You can use a variety of encryption techniques and algorithms to create Macs, such as the Secure Hashing algorithm (SHA), the Message Digest 5 (MD5) algorithm, or the Data Encryption Standard (DES) algorithm. The

View state MAC feature is used to prevent customers from sending requests that contain malicious view state data. By default, the view State MAC feature is enabled by using the enableviewstatemac= "true" flag in the Machine.config file.

To determine if the problem you are experiencing is related to a MAC, the easiest way to do this is to turn off the feature. To do this, set the enable VIEWSTATEMAC flag to False . If you no longer experience view-state errors, the issue is related to the MAC.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.