When the form is submit, the __viewstate and __viewstategenerator are post to another page, and the Verification view state MAC fails.

Source: Internet
Author: User

Error message: Verify view state MAC failed. If this application is hosted by a network farm or cluster, make sure that the configuration specifies the same validationkey and validation algorithms. You cannot use AutoGenerate in a cluster.

Cause Analysis:

F_app_cux_pro.aspx Page Original code:

This.form1.action = "F_add_app_cux_pro.aspx?" Cuxid= "+$ (" #CuxId "). Val () +" "; This.form1.submit ();

That is, from a page submitted to page B, form submit when the page a __viewstate and __viewstategenerator together post to the B page, the Verification view state MAC failed.

Workaround:

1 //if you set the. NET control to disabled, these controls are not committed2 function setviewdisable (_form) {3     //var _form = $ ("#form1");4     var_viewstate = _form.find ("#__VIEWSTATE");//"__viewstate" and "__eventtarget" and "__viewstatefieldcount5     var_eventtarget = _form.find ("#__EVENTTARGET");6     var_viewstatefieldcount = _form.find ("#__VIEWSTATEFIELDCOUNT");7     var_viewstategenerator = _form.find ("#__VIEWSTATEGENERATOR");8 9_viewstate.attr ("Disabled","Disabled");Ten_eventtarget.attr ("Disabled","Disabled"); One_viewstatefieldcount.attr ("Disabled","Disabled"); A_viewstategenerator.attr ("Disabled","Disabled"); - } -  theSetviewdisable ($ ("#form1")); -  This. form1.action ="f_add_app_cux_pro.aspx? Cuxid="+$("#CuxId"). Val () +""; -  This. Form1.submit ();

RELATED links:
Successful controls,http://www.w3.org/tr/rec-html40/interact/forms.html#h-17.13.2 of the form

When the form is submit, the __viewstate and __viewstategenerator are post to another page, and the Verification view state MAC fails.

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.