Causes of Unable To Validate Data
I'm getting "Unable to validate data" in a webfarm scenario but not all the time. I'm getting it about on AVERAGE 1x or 2x per hour but fairly random. All of the causes of this error that I know of are list below:
Machinekey in the machine.config (or web.config) not set the same in a web farm scenario. Mine are set the same in the machine.config.
A page is submitted after a server recycle and the machinekey is set to auto. I'm using a static key which should eliminate this source.
A postback is triggered before a page is loaded. I'm using 3.5 SP1 with the render viewstate at top set to true.
A page that post back to another page or us开发者_如何学运维es server transfer. I'm not.
Serializing an anonymous type into the viewstate
Anti-virus programs or web accelerators on client machine.
A malicious attempt to modify viewstate
These are all of the sources that I know. Any other sources appreciated. Is this fairly typical to see this error 10x-20x times per day?
I see the same errors from time to time from a bunch of our 'heavier' internal applications. I have been at a user's desk when the error was created (logs show the time and user) and there was never actually an error presented to the users. I think it can happen when a user switches requests quickly without the page acutally loading and only partial data is transmitted to the server.
Does the page use ViewState heavily? Eg. controls that repeat like GridView
, Repeater
, ListView
, etc...
It is very rare in the cases I have seen but you should try and verify if a user actually sees this error.
I have actually thought of putting a button on our custom error page in certain cases that says, 'click me if you see this error page' but have never actually implemented it.
精彩评论