Viewstate errors

J

Janaka

We have managed to lock down 99% of the application errors occurring in our
asp.net sites. The only errors which occur on a regular basis now are
viewstate errors. We have disabled viewstate on the majority of pages but
kept them where absolutely necessary, such as shopping carts, adding items,
etc.

Also we've made sure the following have been met:
EnableViewStateMac = false
Disabled viewstate on all controls which are unnecessary
Try using more simplified controls

So our viewstate shouldn't be getting too big. We get the "Viewstate is
invalid" error message cropping up on a small percentage of requests -
depends on activity of the site but overall it is only between 1%-5% of
requests. Although this amount is small I still can't see why viewstate
errors are occurring? The browser types vary (and include MS IE) and we
haven't been able to replicate the error ourselves. Has anyone had this
problem or found a way to track down the causes for the errors?

Thanks,

Janaka
 
B

bruce barker

Viewstate error are hard to track down. the Viewstate is a hidden field, and
any change in its postback value leads to a viewstate error. with the
internet you are dealing with a lot of varibles: browsers, proxy servers,
firewalls, etc.

if one of your clients is having solid problem, you might track it down. for
instance, there are proxy servers that valid postback data, and the
viewstate data gets dropped because the hidden field starts with "_", which
is an illegel first character under the w3c standard. long viewstates are
prone to truncation.

if you really want to research, add a filter that log the outgoing viewstate
(and a request guid - store as a hidden field), and compares the incoming
viewstate to saved value, so you can see the actual transformation.

-- bruce (sqlwork.com)
 
J

Janaka

Bruce,

Thanks for the reply. It still seems a bit flakey to me but I will try to
log the viewstate and check for changes.

Cheers,

J
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top