问题描述
我在ViewState中遇到错误,我在javascript中调用了Submit函数,在asp.net中提交了一个表单并设置了 target =" _blank"在表单标签中,在提交时打开一个新窗口。
I had an error with ViewState, I called the Submit function in javascript to submit a form in asp.net and set target = "_blank" in the form tag to it open a new windows when submitting.
但是在提交时,打开的页面会出现viewstate错误。
But when submitting, the page that is opened occurs an error with viewstate.
[ViewStateException: Invalid viewstate.
Client IP:
Port:
Referer:
Path:
User-Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.162 Safari/535.19
ViewState: /wEPDwUKLTQ5MjQ3MjAzMQ9kFgJmD2QWBAIBD2QWw8WAh4HZW5jdHlwZQUTbXVsdGlwYXJ0L2Zvcm0tZGF0YRYEAgEPZBYuZg8PFgIeC05hdmlnYXRlVXJsBRdodHRwOi8vd3d3LmdpZnRhbmdvLmNvbWQWAmYPDxYEHghJbWFnZVVybAUxfi9JbWFnZXMvR2lmdGFuZ29fbG9nb19Ub3BfTGVmdF9Mb2dvX2hvcnpfdGFnLnBuZx4NQWx0ZXJuYXRlVGV4dAUIR2lmdGFuZ29kZAIBDw8WAh8ABRJQaHVvbmcgTmd1eWVuIE1pbmhkZAIDDw8WAh8ABQ4oODc3KSA0NDMtODI2NGRkAgQPDxYCHwIFG21haWx0bzpzdXBwb3J0QGdpZnRhbmdvLmNvbWRkAgUPDxYCHwIFGX4vUEFTUyUyMFVzZXIlMjBHdWlkZS5wZGZkZAIGDxYCHgdWaXNpYmxlaGQCBw8PFgIfAwUdLi4vSW1hZ2VzL1R5cGVzL2dpZnRjYXJkcy5wbmdkZAIIDw8WAh8FaGRkAgkPZBYCZg8PFgIfBWhkZAIKDw8WAh8DBTtodHRwOi8vc3RhZ2luZy53d3cuZ2lmdGFuZ28uY29tL0dQQ0dyYXBoaWNzLzAxMzE3MF9Mb2dvLmpwZ2RkAgwPZBYCAgEPDxYCHwVo...]
[HttpException (0x80004005): Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster.]
System.Web.UI.ViewStateException.ThrowMacValidationError(Exception inner, String persistedState) +11361534
System.Web.UI.ObjectStateFormatter.Deserialize(String inputString) +11361969
System.Web.UI.Util.DeserializeWithAssert(IStateFormatter formatter, String serializedState) +60
System.Web.UI.HiddenFieldPageStatePersister.Load() +11362247
System.Web.UI.Page.LoadPageStateFromPersistenceMedium() +11442359
System.Web.UI.Page.LoadAllState() +56
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +11436386
System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +11435902
System.Web.UI.Page.ProcessRequest() +269
System.Web.UI.Page.ProcessRequest(HttpContext context) +167
ASP.t2_cert_mycertificate_aspx.ProcessRequest(HttpContext context) in c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\cert\37249763\f5a891e8\App_Web_3ivgjqvh.9.cs:0
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +625
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +270
有人能告诉我为什么会出现这个错误吗?以及如何解决它。我尝试了很多方法来修复,但它没有影响。
can someone tell me why it occurs this error ? and how to fix it. I tried many way to fix but it doesn't affect.
我猜接收数据的页面无法解析某些控件的ViewState。
I guess the page that receives data cannot parse ViewState of some controls.
推荐答案
http://stackoverflow.com/questions/1398914/validation-of-viewstate-mac-failed-on-postback到不同的页面
我认为这是你的解决方案
I think this is your solution
这篇关于ViewStateException:viewstate loadViewstate函数无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!