现在的位置: 首页 > 综合 > 正文

Asp.net ajax 调用WebService 用userContext 传递不了参数的错误

2012年01月08日 ⁄ 综合 ⁄ 共 290字 ⁄ 字号 评论关闭

 

userContext = workerID;

WorkerService.Delete(workerID, onDeleteSuccceed, onDeleteError, userContext );

 

function onDeleteSuccceed(userContext )

{

  alert(userContext );  // null
}

 

原因: 尽管WorkerService.Delete, 没有返回值, 也要在回调函数中添加result 参数.

 

function onDeleteSuccceed(result, userContext )

{

  alert(userContext );  // OK

}

 

抱歉!评论已关闭.