Viewstate error problem!

  • Thread starter Thread starter FabFreddy
  • Start date Start date
F

FabFreddy

Hi,

I get the "Unable to validate data". It appears when I do a autopostback!
Can anybody tell me what the problem is?

Thx
 
This indicates the viewstate of the page posted back to the server is not
what was expected. Either the server cannot read it or it does not match up
with the controls on the page.

A few possible reasons:

If you add any controls to the page using code, on post back the controls
need to be added back to the page, the same controls need to be added back
in the exact same order. If you don't add them back or add different ones
in a different order before the viewstate is parsed you would get this
error...the viewstate hasn't changed but the controls don't match up with it
anymore.

You are viewing the page, you alter the page in your designer and upload
that change before post back.

You are using viewstateMAC, to encrypt the viewstate, and the Message
Authenication Code is reset i.e. timeout, server reset (these would
typically require you to sit on a page for quite some time), when using
server farm with the machinekey not syncronized between the servers.etc or
if you use a use Server.Transfer in the page and the MAC is not the same on
the two pages..

Another version of this message is "Viewstate is invalid for this page"
(depends on the version of .Net and what if any service pack / hotfixe you
may have installed).
 
I am also getting the same error. I am not on a Server Farm, however, I
am using Server.Transfer taking advantage of the performance gain and
being able to add querystring values to the Context.

Doing some research, some people mentioned that if you specify the
second parameter value to Server.Transfer as true would cause this
problem to occur, however, thats not the case for me.

The wierd part is that I cannot replicate this problem on my development
box which is on a Windows XP Professional machine running IIS 5. I keep
getting this error on a Window 2003 production box.

Any help would be greatly appreciated.
 
Back
Top