N
Neo
Hi,
I use asynchronous mode of web service in asp.net page and specify a callback function.
My question is how can I keep the returned value ? It is not use that I added the returned value to session.
Thanks
The following is part of my codes.
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If Not IsPostBack Then
Dim rMessage As New messagepublisher.UpdateMessage
Dim cb As AsyncCallback
cb = New AsyncCallback(AddressOf Me.GetMessage)
Dim ar As IAsyncResult = rMessage.BeginReceieveMessage(cb, rMessage)
Else
Response.Write(Session("ok"))
End If
End Sub
Private Sub GetMessage(ByVal ar As IAsyncResult)
Dim rMessage As MessagePublisher.UpdateMessage = ar.AsyncState
Dim m As string= rMessage.EndReceieveMessage(ar)
Session("ok") = m 'This is not working. This line is executed ,but I can not get the value of session("ok") when postback.
End Sub
I use asynchronous mode of web service in asp.net page and specify a callback function.
My question is how can I keep the returned value ? It is not use that I added the returned value to session.
Thanks
The following is part of my codes.
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If Not IsPostBack Then
Dim rMessage As New messagepublisher.UpdateMessage
Dim cb As AsyncCallback
cb = New AsyncCallback(AddressOf Me.GetMessage)
Dim ar As IAsyncResult = rMessage.BeginReceieveMessage(cb, rMessage)
Else
Response.Write(Session("ok"))
End If
End Sub
Private Sub GetMessage(ByVal ar As IAsyncResult)
Dim rMessage As MessagePublisher.UpdateMessage = ar.AsyncState
Dim m As string= rMessage.EndReceieveMessage(ar)
Session("ok") = m 'This is not working. This line is executed ,but I can not get the value of session("ok") when postback.
End Sub