Export (0) Print
Expand All

WebViewStateFailureAuditEvent Class

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

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

public class WebViewStateFailureAuditEvent : WebFailureAuditEvent

The WebViewStateFailureAuditEvent type exposes the following members.

  NameDescription
Protected methodWebViewStateFailureAuditEvent(String, Object, Int32, ViewStateException)Infrastructure. Initializes the WebViewStateFailureAuditEvent class using the supplied parameters.
Protected methodWebViewStateFailureAuditEvent(String, Object, Int32, Int32, ViewStateException)Infrastructure. Initializes a new instance of the WebViewStateFailureAuditEvent class using the supplied parameters.
Top

  NameDescription
Public propertyEventCodeGets the code value associated with the event. (Inherited from WebBaseEvent.)
Public propertyEventDetailCodeGets the event detail code. (Inherited from WebBaseEvent.)
Public propertyEventIDGets the identifier associated with the event. (Inherited from WebBaseEvent.)
Public propertyEventOccurrenceGets a counter that represents the number of times the event has occurred. (Inherited from WebBaseEvent.)
Public propertyEventSequenceGets the number of times the event has been raised by the application. (Inherited from WebBaseEvent.)
Public propertyEventSourceGets the object that raises the event. (Inherited from WebBaseEvent.)
Public propertyEventTimeGets the time when the event was raised. (Inherited from WebBaseEvent.)
Public propertyEventTimeUtcGets the time when the event was raised. (Inherited from WebBaseEvent.)
Public propertyMessageGets the message that describes the event. (Inherited from WebBaseEvent.)
Public propertyProcessInformationGets information about the ASP.NET application-hosting process. (Inherited from WebManagementEvent.)
Public propertyRequestInformationGet the information associated with the Web request. (Inherited from WebAuditEvent.)
Public propertyViewStateExceptionGets the exception caused by the failure.
Top

  NameDescription
Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodFormatCustomEventDetailsProvides standard formatting of the event information. (Inherited from WebBaseEvent.)
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodIncrementPerfCountersInfrastructure. Increments the Audit Failure Events Raised performance counter. (Inherited from WebFailureAuditEvent.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodRaise()Raises an event by notifying any configured provider that the event has occurred. (Inherited from WebBaseEvent.)
Public methodToString()Formats event information for display purposes. (Inherited from WebBaseEvent.)
Public methodToString(Boolean, Boolean)Formats event information for display purposes. (Inherited from WebBaseEvent.)
Top

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.

NoteNote

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:

?__VIEWSTATEFIELDCOUNT=1&__VIEWSTATE=bogus

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

<healthMonitoring
  enabled="true"
  heartBeatInterval="0">
  <providers>
    // Configure the provider to process 
    // the health events.
    <add name="EventLogProvider"
       type="System.Web.Management.EventLogWebEventProvider,
       System.Web,Version=2.0.3600.0,Culture=neutral,
       PublicKeyToken=b03f5f7f11d50a3a"/>
  </providers>

  <eventMappings>
    <clear />
    // Configure the WebFailureAuditEvent 
    // object to handle the Viewstate failures. 
    <add name="Failure Audits"
      type="System.Web.Management.WebFailureAuditEvent,
      System.Web,Version=2.0.3600.0,Culture=neutral,
      PublicKeyToken=b03f5f7f11d50a3a" />
  </eventMappings>

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

.NET Framework

Supported in: 4.5, 4, 3.5, 3.0, 2.0

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

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

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