PageAsyncTask.State Property

 

Gets an object that represents the state of the task.

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

Public Property State As Object
	Get
	Private Set
End Property

Property Value

Type: System.Object

An Object that represents the state of the task.

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
Return to top
Show: