Export (0) Print
Expand All

PageAsyncTask.ExecuteInParallel Property

Gets a value that indicates whether the task can be processed in parallel with other tasks.

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

'Declaration
Public Property ExecuteInParallel As Boolean

Property Value

Type: System.Boolean
true if the task should be processed in parallel with other tasks; otherwise, false.

The ExecuteInParallel property is set in the constructor. When multiple tasks are registered in a page and the ExecuteInParallel property is set to true, then those tasks are processed concurrently. However, if the ExecuteInParallel property is set to false, then those tasks are processed sequentially. For example, if a page contained two asynchronous tasks that each took 5 seconds to complete and ExecuteInParallel is set to true, both tasks will complete in 5 seconds. If ExecuteInParallel is set to false for these same two tasks, then the first task will complete in 5 seconds and the second task will complete 5 seconds after the completion of the first task.

The following code example defines three asynchronous tasks that are each set to be processed in parallel. This example is part of a larger example found in the PageAsyncTask class overview.

Dim asyncTask1 As New PageAsyncTask(AddressOf slowTask1.OnBegin, AddressOf slowTask1.OnEnd, AddressOf slowTask1.OnTimeout, "Async1", True)
Dim asyncTask2 As New PageAsyncTask(AddressOf slowTask2.OnBegin, AddressOf slowTask2.OnEnd, AddressOf slowTask2.OnTimeout, "Async2", True)
Dim asyncTask3 As New PageAsyncTask(AddressOf slowTask3.OnBegin, AddressOf slowTask3.OnEnd, AddressOf slowTask3.OnTimeout, "Async3", True)

' Register the asynchronous task.
Page.RegisterAsyncTask(asyncTask1)
Page.RegisterAsyncTask(asyncTask2)
Page.RegisterAsyncTask(asyncTask3)

.NET Framework

Supported in: 4.5.2, 4.5.1, 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.

Show:
© 2014 Microsoft