WebRequestEvent Class
Assembly: System.Web (in system.web.dll)
The WebRequestEvent is raised at every Web request.
It uses the WebRequestInformation class to obtain request information.
Note: |
|---|
|
In most cases you will use the standard ASP.NET health-monitoring types and control their behavior by setting the healthMonitoring configuration section. You can also create custom types, as shown in the next example. If you create your custom event type and you need to add your own information, customize the FormatCustomEventDetails method. This will avoid overwriting or tampering with sensitive system information. |
| Topic | Location |
|---|---|
| How to: Implement and Raise Custom ASP.NET Health Monitoring Events | Building ASP .NET Web Applications |
| How to: Implement the Health Monitoring Custom Provider Example | Building ASP .NET Web Applications |
| How to: Implement and Raise Custom ASP.NET Health Monitoring Events | Building ASP .NET Web Applications |
| How to: Implement the Health Monitoring Custom Provider Example | Building ASP .NET Web Applications |
The following code example shows how to derive from the WebRequestEvent class to create a custom event.
The following is an excerpt of the configuration file that enables ASP.NET to use the custom event.
<healthMonitoring
enabled="true" heartBeatInterval="0">
<providers>
<!-- Define the custom provider that
processes custom Web request events. -->
<add name="SampleWebEventProvider"
type="SamplesAspNet.SampleEventProvider,webeventprovider,Version=1.0.1573.18094, Culture=neutral, PublicKeyToken=b5a57a9a9d487cf4, processorArchitecture=MSIL"/>
</providers>
<eventMappings>
<!-- Define the event source that
issues custom events. -->
<add name="SampleWebRequestEvent"
type="SamplesAspNet.SampleWebRequestEvent,webrequestevent,Version=1.0.1573.23947, Culture=neutral, PublicKeyToken=e717d983a78c8ddb, processorArchitecture=MSIL"/>
</eventMappings>
<rules>
<!-- Associate custom event with
related custom provider -->
<add
name="CustomWebRequestEvent"
eventName="SampleWebRequestEvent"
provider="SampleWebEventProvider"
profile="Critical"/>
</rules>
</healthMonitoring>
- AspNetHostingPermission for operating in a hosted environment. Demand value: LinkDemand; Permission value: Minimal.
- AspNetHostingPermission for operating in a hosted environment. Demand value: InheritanceDemand; Permission value: Minimal.
System.Web.Management.WebBaseEvent
System.Web.Management.WebManagementEvent
System.Web.Management.WebRequestEvent
Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.
Note: