Export (0) Print
Expand All

EventHandlerTaskAsyncHelper Class

.NET Framework 4.5

Converts task-returning asynchronous methods into methods that use the asynchronous programming model used in previous versions of ASP.NET and that is based on begin and end events.

System.Object
  System.Web.EventHandlerTaskAsyncHelper

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

'Declaration
Public NotInheritable Class EventHandlerTaskAsyncHelper

The EventHandlerTaskAsyncHelper type exposes the following members.

  NameDescription
Public methodEventHandlerTaskAsyncHelperInitializes a new instance of the EventHandlerTaskAsyncHelper class.
Top

  NameDescription
Public propertyBeginEventHandlerRepresents the BeginEventHandler method for an asynchronous task.
Public propertyEndEventHandlerRepresents the EndEventHandler method for an asynchronous task.
Top

  NameDescription
Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

To handle asynchronous tasks in ASP.NET 4.5, you implement the logic to return a task as a TaskEventHandler delegate. This model of asynchronous task-based programming supersedes the model used in previous versions of ASP.NET, which bases all event handling on begin and end events. After you implement a TaskEventHandler delegate, you can then pass it to the EventHandlerTaskAsyncHelper constructor, which wraps the task-returning logic and converts the handler to the model that uses begin and end events. The EventHandlerTaskAsyncHelper class enables your TaskEventHandler object to be compatible with the ASP.NET page framework. When you call the AddOnPreRenderCompleteAsync method to process the task for an asynchronous page, you can use the BeginEventHandler and EndEventHandler properties to pass the converted begin and event handlers to the method.

.NET Framework

Supported in: 4.6, 4.5

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