我有一个网络服务asmx
,我有这些方法
<WebMethod()>
Public Function VerifyCalcAlgoFinish() As Boolean
Try
Debug.Print(Session.SessionID)
Return Session("session_variable") = True
Catch ex As Exception
Return False
End Try
End Function
<WebMethod(EnableSession:=True)> _
Public Function Calc() As boolean
If Session("session_variable") Is Nothing Then
Session("session_variable") = false
End If
Try
// some instructions
Session("session_variable") = true
Catch ex As Exception
Session("session_variable") = false
End Try
Return Session("session_variable")
End Function
我的问题是当我调用Debug.Print(Session.SessionID)
时,我收到错误表示Session对象没有实例化。所以我需要知道
答案 0 :(得分:1)
您需要传递从客户端创建的会话ID,这将存储在服务器端。在进行另一次通话时,您将检查会话是否已存在......