【发布时间】:2020-04-17 02:13:32
【问题描述】:
我在我的一个 Web 应用程序中执行以下操作。我有一个返回值的函数。该值应传递给一个单独运行到我的 Web 应用程序的 Web 服务方法。此 Web 服务操作需要一些时间才能完成,因此必须在后台运行,并在完成后返回一条消息。我想通过 Javascript 回调来做到这一点。代码基本流程如下;
Dim shr_intfB_Common_LCI As clsCreamsCommon
Dim stringResult As StringResult
shr_intfB_Common_LCI = New clsCreamsCommon
Call shr_intfB_Common_LCI.CreamsBooking(clsTapsCreamsPropsDtl,
intRetCode, strMessage, intRequestId
)
// This intRequestId needs to be passed to the following web service.
Do
Threading.Thread.Sleep(10 * 1000) '10 Second
stringResult = objService.CheckRequestStatus(objServiceUser, intRequestId)
Loop Until stringResult Is Nothing Or stringResult.ReturnCode <> 2
//The stringResult includes the followings which I have to display.
MessageBox(Me, stringResult.ReturnCode, stringResult.ReturnData + stringResult.ReturnMessage)
我想在不使用线程或任务的情况下执行此操作,因为这是一个 Web 应用程序,但使用 JavaScript 回调。请帮帮我。
【问题讨论】:
标签: javascript asp.net ajax web-services