Hello Scott,
As for the ViewState validation error you encountered, there does exists
some issue that will result to the behavior. One is hosting web applicaiton
in webfarm environment which cause request send to different server (with
different machinekey) raise viewstate validation error. Another problem is
as you said, the ViewStateMac(enabled by default) is a randomly generated
digest value and it is not expected to work forever, and that's why
sometimes the server will also raise such error when use pickup a url from
the webcrawler's search result cache(which contains invalid viewstate
content).
So far, the ASP.NET's ViewState setting only provide the
"EnableViewStateMac" and "viewStateEncryptionMode" two configuration
options, and the "viewStateEncryptionMode" is specific to viewstate
encryption which is not used normally. As for ViewStateMac, we can only
control whether to enable it, but can not control the valid lifecycle of
the generated MAC value(it is internally fixed). BTW, since the error
will raise occasionally when the user postback a form after a long period
idle, do you think it possible that you embed some client-script in your
certain page (which need such protetion) and automatically postback the
form after a certain long period? Thus, if the user hasn't perform any
action on the form for a long time, the page will postback itself to make
its states refresh. Also, you can disable ViewStatemac for the certain
pages, however, there will still raise server-side exception when the
ViewState is corrupted.
Please feel free to post here if you have any other ideas or questions.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.