System. Web. httpexception: data cannot be verified

Source: Internet
Author: User
Tags stack trace
Data cannot be verified.

Note:An error occurred while executing the current Web request. Check the stack trace information for details about the error and the source of the error in the code.

Exception details:System. Web. httpexception: data cannot be verified.

Source error:

An unhandled exception is generated during the execution of the current Web request. You can use the following exception stack trace information to determine the cause and location of the exception.

Stack trace:

[Httpexception (0x80004005): data cannot be verified.]
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 updated upted.]
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: Authorization + response + o2w8ddx0pdtwpgw8atwwpjs + response + 45yaf6yoo5yws5pah5l + d5a + gpjs + PJs + ozs + response + PJs + response + 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

 

Solution: Disable Mac in the page command (authentication code): <% @ page enableviewstatemac = "false">

View status message authentication code (MAC) is an identity authentication tag (also knownCheck Value), This code is created when the authentication scheme and key are applied to the message at the same time. Mac performs computation and verification by using the same key. Therefore, Mac can only be verified by the specified receiver. You can use a variety of encryption technologies and algorithms to create Mac, such as the security hash algorithm (SHA), message digest 5 (MD5) algorithm, or Data Encryption Standard (DES) algorithm.

The view status Mac function prevents customers from sending requests containing malicious view status data. By default, the view status Mac function usesEnableviewstatemac = "true"Flag enabled.

To determine whether the problem is related to Mac, the simplest way is to disable this function. For this reasonEnable viewstatemacFlag is setFalse. If you no longer encounter a view status error, the problem is related to 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.