S
sandrofurlan
Hi all,
I'm a newbie about asp.net.
I've a web client that call in async mode one webservice method
The problem is that I don't know how to refresh control text property.
Some code:
Protected Sub ServiceCallback(ByVal ar As IAsyncResult)
Dim client As ServiceClient = ar.AsyncState
Dim e As ServiceEventArgs = client.EndWaitEvent(ar)
If e.Status = 4 Then
Label1.text = "result OK" <----
Else
Label1.text = "result False" <----
End If
' reload callback handler
Dim callBack As New AsyncCallback(AddressOf ServiceCallback)
client.BeginWaitEvent(callBack, client)
End Sub
Protected Sub form1_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles form1.Load
Dim client As New ServiceClient
Label1.Text = "Open" & client.StartService()
Dim callBack As New AsyncCallback(AddressOf ServiceCallback)
Dim Iar As IAsyncResult = client.BeginWaitEvent(callBack,
client)
End Sub
The problem is that label1.text could not change.
Some idea?
Thanks,
Sandro Furlan
I'm a newbie about asp.net.
I've a web client that call in async mode one webservice method
The problem is that I don't know how to refresh control text property.
Some code:
Protected Sub ServiceCallback(ByVal ar As IAsyncResult)
Dim client As ServiceClient = ar.AsyncState
Dim e As ServiceEventArgs = client.EndWaitEvent(ar)
If e.Status = 4 Then
Label1.text = "result OK" <----
Else
Label1.text = "result False" <----
End If
' reload callback handler
Dim callBack As New AsyncCallback(AddressOf ServiceCallback)
client.BeginWaitEvent(callBack, client)
End Sub
Protected Sub form1_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles form1.Load
Dim client As New ServiceClient
Label1.Text = "Open" & client.StartService()
Dim callBack As New AsyncCallback(AddressOf ServiceCallback)
Dim Iar As IAsyncResult = client.BeginWaitEvent(callBack,
client)
End Sub
The problem is that label1.text could not change.
Some idea?
Thanks,
Sandro Furlan