PageAsyncTask.State Property
.NET Framework (current version)
Gets an object that represents the state of the task.
Assembly: System.Web (in System.Web.dll)
The State property is set in the constructor and cannot be modified during execution of the asynchronous task. You can differentiate asynchronous tasks in a page by assigning unique string values to their respective State properties.
The following code example creates three asynchronous tasks and gives them unique values for their State properties. 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
Available since 2.0
Available since 2.0
Show: