【发布时间】:2019-01-24 07:09:30
【问题描述】:
我收到了 Viewstate 验证失败的错误消息。原因:视图状态提供的完整性检查失败。在我回收 IIS 之前,无法使用我的网站保存数据。我读到这与服务器场中的机器密钥有关。我不知道?这只是一个独立的网络服务器。任何想法如何纠正这个问题?
Event code: 4009 Event message: Viewstate verification failed. Reason: The viewstate supplied failed integrity check. Event time: 8/26/2013 3:30:58 PM Event time (UTC): 8/26/2013 7:30:58 PM Event ID: 6edb892ff6194dc48ef1182cee318e63 Event sequence: 4 Event occurrence: 1 Event detail code: 50203 Application information:
Application domain: /LM/W3SVC/2/ROOT-1-130220190575673097
Trust level: Full
Application Virtual Path: /
Application Path: C:\inetpub\wwwroot\website\
Machine name: Process information:
Process ID: 3636
Process name: w3wp.exe
Account name: Domain\account Request information:
Request URL:
Request path: /frmFoodAndBeverage.aspx
User host address:
User:
Is authenticated: True
Authentication Type: Negotiate
Thread account name: Domain\account ViewStateException information:
Exception message: Invalid viewstate.
Client IP:
Port:
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR
3.0.30729; Media Center PC 6.0; InfoPath.3; .NET4.0C; .NET4.0E; Tablet PC 2.0)
PersistedState: /wEPDwUKLTYzODM0NTY2Mg9kFgJmD2QWAgIDD2QWAgIDDw8WAh4EVGV4dAUPQmVsbCwgRG9uYWxkIEUuZGQYAQUeX19Db250cm9sc1JlcXVpcmVQb3N0QmFja0tleV9fFgEFIWN0bDAwJENvbnRlbnRQbGFjZUhvbGRlcjEkY21kTmV4dF5K3yklWc0DODJ8SLoJw+dFVUlgm/CktMaD1teAlLBl
Referer:
Path: /frmFoodAndBeverage.aspx Custom event details:
【问题讨论】:
-
你认为设置 enableViewStateMac="false" 会解决这个问题吗?
-
我在我的代码中使用了很多会话变量,这可能是为什么
-
尝试禁用 mac 检查,看看会发生什么。但是,您应该将变量保存在 Session 中的服务器端,而不是 Viewstate 中,这样您的页面会产生大量数据并使其加载缓慢..
-
不,不要在 machine.config 中这样做!它将改变您机器中所有 Web 应用程序的行为!而是在 web.config 中更改它,以仅修改当前应用程序。
请注意,禁用此检查是一种非常糟糕的做法!