This documentation is archived and is not being maintained.

WebViewStateFailureAuditEvent Class

Provides Web-application view-state-related-failure information.

Namespace:  System.Web.Management
Assembly:  System.Web (in System.Web.dll)

[AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public class WebViewStateFailureAuditEvent : WebFailureAuditEvent

ASP.NET health monitoring allows production and operations staff to manage deployed Web applications. The System.Web.Management namespace contains the health-event types responsible for packaging application health-status data and the provider types responsible for processing this data. It also contains supporting types that help during the management of health events.

ASP.NET raises events of type WebViewStateFailureAuditEvent when a view-state failure occurs. This failure indicates either an attempt to tamper with view state or its reuse from another machine with a different key. The related audit event code is AuditInvalidViewStateFailure.


In most cases you will be able to use the ASP.NET health-monitoring types as implemented, and you will control the health-monitoring system by specifying values in the healthMonitoring configuration section. You can also derive from the health-monitoring types to create your own custom events and providers.

The following is an excerpt of a configuration file showing how to configure the EventLogWebEventProvider to capture view-state failures. For completeness we are showing the setup for the provider and eventMappings sections. They are already set by default. The only thing you need to do is to provide the setup for the rules section. Refer to healthMonitoring for more information.

To generate a view-state error, enter a URL in your browser with the following query string:


The Windows Application Eventlog will capture a view-state failure, if you enter the following configuration settings.

    // Configure the provider to process 
    // the health events.
    <add name="EventLogProvider"

    <clear />
    // Configure the WebFailureAuditEvent 
    // object to handle the Viewstate failures. 
    <add name="Failure Audits"
      PublicKeyToken=b03f5f7f11d50a3a" />

    // Configure the connection between the 
    // application lifetime event object 
    // and the provider that must process it.
      <add name="Viewstate Failure Events "
        eventName="Failure Events"
        minInterval="00:01:00" />

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0