WebViewStateFailureAuditEvent Class

 

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

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

System.Object
  System.Web.Management.WebBaseEvent
    System.Web.Management.WebManagementEvent
      System.Web.Management.WebAuditEvent
        System.Web.Management.WebFailureAuditEvent
          System.Web.Management.WebViewStateFailureAuditEvent

public class WebViewStateFailureAuditEvent : WebFailureAuditEvent

NameDescription
System_CAPS_protmethodWebViewStateFailureAuditEvent(String, Object, Int32, Int32, ViewStateException)

This API supports the product infrastructure and is not intended to be used directly from your code. Initializes a new instance of the WebViewStateFailureAuditEvent class using the supplied parameters.

System_CAPS_protmethodWebViewStateFailureAuditEvent(String, Object, Int32, ViewStateException)

This API supports the product infrastructure and is not intended to be used directly from your code. Initializes the WebViewStateFailureAuditEvent class using the supplied parameters.

NameDescription
System_CAPS_pubpropertyEventCode

Gets the code value associated with the event.(Inherited from WebBaseEvent.)

System_CAPS_pubpropertyEventDetailCode

Gets the event detail code.(Inherited from WebBaseEvent.)

System_CAPS_pubpropertyEventID

Gets the identifier associated with the event.(Inherited from WebBaseEvent.)

System_CAPS_pubpropertyEventOccurrence

Gets a counter that represents the number of times the event has occurred.(Inherited from WebBaseEvent.)

System_CAPS_pubpropertyEventSequence

Gets the number of times the event has been raised by the application.(Inherited from WebBaseEvent.)

System_CAPS_pubpropertyEventSource

Gets the object that raises the event.(Inherited from WebBaseEvent.)

System_CAPS_pubpropertyEventTime

Gets the time when the event was raised.(Inherited from WebBaseEvent.)

System_CAPS_pubpropertyEventTimeUtc

Gets the time when the event was raised.(Inherited from WebBaseEvent.)

System_CAPS_pubpropertyMessage

Gets the message that describes the event.(Inherited from WebBaseEvent.)

System_CAPS_pubpropertyProcessInformation

Gets information about the ASP.NET application-hosting process.(Inherited from WebManagementEvent.)

System_CAPS_pubpropertyRequestInformation

Get the information associated with the Web request.(Inherited from WebAuditEvent.)

System_CAPS_pubpropertyViewStateException

Gets the exception caused by the failure.

NameDescription
System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_protmethodFinalize()

Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)

System_CAPS_pubmethodFormatCustomEventDetails(WebEventFormatter)

Provides standard formatting of the event information.(Inherited from WebBaseEvent.)

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_protmethodIncrementPerfCounters()

This API supports the product infrastructure and is not intended to be used directly from your code. Increments the Audit Failure Events Raised performance counter.(Inherited from WebFailureAuditEvent.)

System_CAPS_protmethodMemberwiseClone()

Creates a shallow copy of the current Object.(Inherited from Object.)

System_CAPS_pubmethodRaise()

Raises an event by notifying any configured provider that the event has occurred.(Inherited from WebBaseEvent.)

System_CAPS_pubmethodToString()

Formats event information for display purposes.(Inherited from WebBaseEvent.)

System_CAPS_pubmethodToString(Boolean, Boolean)

Formats event information for display purposes.(Inherited from WebBaseEvent.)

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.

System_CAPS_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
Available since 2.0

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

Return to top
Show: